Skip to content

Docker Setup

Sayrix edited this page Apr 25, 2026 · 2 revisions

Ticket-Bot includes a Dockerfile and docker-compose.yml for containerized hosting.

Files Used by Docker

The compose service uses:

env_file:
  - ./config/.env
volumes:
  - ./config:/app/config:ro
  - ./messages:/app/messages:ro
  - ./.data:/app/.data

This means:

  • config/.env provides runtime environment variables.
  • config/config.ts is mounted into the container.
  • messages/ is mounted so message templates can be customized without rebuilding the image.
  • .data/ is mounted so the SQLite database survives container recreation.

Prepare Config

Create config/.env:

DISCORD_TOKEN=your_bot_token_here
DB_FILE_NAME=file:/app/.data/ticket-bot.db
TICKETPM_PASSKEY=

Copy and edit the config:

cp config/config.example.ts config/config.ts

PowerShell:

Copy-Item config/config.example.ts config/config.ts

Replace the placeholder Discord IDs in config/config.ts before starting the container.

Start with Compose

docker compose up -d --build

View logs:

docker compose logs -f bot

Stop:

docker compose down

Data Persistence

Do not delete .data/ unless you intentionally want to remove local ticket history and panel tracking.

Back up:

  • .data/
  • config/config.ts
  • config/.env
  • custom files under messages/

Updating a Docker Install

git pull
docker compose up -d --build

If a release includes database schema changes, make sure the schema is applied. The project has a bun run drizzle:push script for that.

Docker Troubleshooting

If the bot starts but does not post panels:

  • Check docker compose logs -f bot.
  • Confirm DISCORD_TOKEN is present in config/.env.
  • Confirm DB_FILE_NAME points inside /app/.data.
  • Confirm config/config.ts exists and has real Discord IDs.
  • Confirm the bot can access each configured panel channel.

If the image build fails around database setup, run the local installation path in Installation while checking the Dockerfile and build context. The runtime container still expects the same config/, messages/, and .data/ layout described above.

Clone this wiki locally