-
Notifications
You must be signed in to change notification settings - Fork 7
Docker
- Run Stelle with a single command.
- The bundled
docker-compose.ymlbrings up MongoDB and Redis for you β you only bring your Lavalink node.
-
Docker with Compose v2 (
docker compose, not the olddocker-compose). - A Lavalink node reachable from the container (see the note below).
Docker only provides the secrets and the databases via environment variables. Everything else (your Lavalink node, channel ids, developer ids, colorsβ¦) still lives in the config file, which is compiled into the image at build time.
- Create/edit your
local.config.ts(ordefault.config.ts) in/src/config/as usual. - Set your Lavalink
nodesthere.
Important
Inside a container, localhost is the container itself, not your host machine. If your Lavalink runs on the same host, set the node host to one of:
-
host.docker.internal(Docker Desktop on Windows/macOS), - your host's LAN IP,
- or a public node.
Also make sure the node port/password in the config match your Lavalink.
Next to docker-compose.yml, create a .env with your secrets. MongoDB and Redis are provided by Compose, so you only need:
TOKEN="your-discord-token"
ERRORS_WEBHOOK="your-error-webhook-url"
# Optional: password for the bundled Redis (defaults to "stelle")
# REDIS_PASSWORD="change-me"Note
DATABASE_URL and the REDIS_* host/port are set by Compose to point at the bundled services β you don't need them in .env.
docker compose up -d --buildThat's it. This builds the bot image and starts three containers:
| Service | Image | Purpose |
|---|---|---|
stelle-bot |
built from the Dockerfile
|
The bot. |
stelle-mongo |
mongo:7 |
Database (single-node replica set, required by Prisma). |
stelle-redis |
redis:7-alpine |
Queue store / cache. |
The bot waits until Mongo and Redis are healthy before starting.
# Follow the logs
docker compose logs -f bot
# Stop everything
docker compose down
# Stop AND wipe the database/cache volumes
docker compose down -v
# Apply code or config changes (rebuild the image)
docker compose up -d --buildTip
Config and code are baked into the image, so after changing them re-run with --build.
-
MongoDB replica set β Prisma requires MongoDB to run as a replica set. The
mongoservice starts with--replSet rs0and a healthcheck initiates the set on first run. -
Data persistence β sessions (24/7, resume), rendered banners, and the databases live in named volumes (
stelle-cache,stelle-logs,mongo-data,redis-data), so they survive restarts. Named volumes (not bind mounts) also let the non-root bot user write to them. -
Multi-stage build β dependencies are installed and the app is compiled in a builder stage; the final image only ships the compiled
dist/, productionnode_modules,assets/(banner fonts), and the Prisma query engine. - Non-root β the bot runs as an unprivileged user.
Note
MongoDB works out of the box, but the @unique indexes are only created by prisma db push. If you want them enforced, run pnpm db:push once against your DATABASE_URL (optional for a personal bot).
| Symptom | Likely cause |
|---|---|
Bot logs ECONNREFUSED to Lavalink |
Node host is localhost (points at the container) or wrong port/password β see step 1. |
TOKEN/ERRORS_WEBHOOK error on start |
Missing from .env. |
| Mongo unhealthy / bot never starts | Give it a few seconds on first run β the replica set is initializing (start_period). |
| Redis auth errors |
REDIS_PASSWORD in .env must match what the bot uses (Compose keeps them in sync). |
Made with
Getting started
Using Stelle
Advanced
Reference