Docker Compose
Separate services with Docker Compose: start-up, domain and TLS, stack checks, validated backups, and incidents.
In brief
Docker Compose separates PostgreSQL, backend, worker, frontend, and documentation, and serves Brume behind your domain with TLS. This page covers start-up, the stack runbook, and validated backups.
This is the right choice for a durable self-host on a single host. 8000 is the default published backend port; replace <date> in the backup commands.
Start
The compose file lives at deploy/compose/docker-compose.yml, and Compose resolves all of its relative paths against that directory: run the commands from there (or pass -f deploy/compose/docker-compose.yml), never from the repository root. The .env file, on the other hand, stays at the root — the compose file reads it through env_file: ../../../.env.
Prepare the environment
Copy the root environment file — cp .env.example .env — then fill in the secrets. BRUME_EDITION defaults to community; the Enterprise edition has its own page.
Launch the stack
cd deploy/compose
JWT_SECRET="$(openssl rand -hex 32)" \
APP_ENCRYPTION_KEY="$(python3 -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())')" \
docker compose up -dThe build contexts point to the repository root; images are built from source. Secrets come from your environment or a gitignored .env — nothing sensitive is committed.
At startup, the one-shot database-migrations service creates the roles and applies the migrations, then stops: it is the only container that receives the database administration credentials, and it exits before the API and the worker start. A docker compose ps showing it as Exited (0) is the normal state.
One-click upgrades: the selfupdate profile
The superadmin upgrade button relies on the updater container, the only holder of the Docker socket, and it ships disabled. To arm it: docker compose --profile selfupdate up -d. Without that profile, the button cannot restart anything — the full procedure is in Upgrade.
Domain & TLS
Place a reverse proxy (Caddy, Traefik, nginx) in front of frontend (3000), docs (3001), and backend (8000). Runtime environment variables configure the public addresses without rebuilding the frontend: NEXT_PUBLIC_APP_DOMAIN and APP_DOMAIN identify the application, while DOCS_URL provides the public URL of the bundled documentation. These values reach the browser through /api/public/runtime-config.
Check the stack
docker compose ps
docker compose logs --tail 100 backend worker postgres
curl -fsS http://localhost:8000/health
docker compose exec postgres sh -c \
'pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"'
docker compose logs -f backend worker postgresBack up and validate
Export the database
umask 077
docker compose exec -T postgres sh -c \
'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB"' > brume-<date>.sql
test -s brume-<date>.sqlRestore into an isolated database
docker compose exec -T postgres sh -c \
'createdb -U "$POSTGRES_USER" brume_restore'
docker compose exec -T postgres sh -c \
'psql -U "$POSTGRES_USER" -d brume_restore' < brume-<date>.sql
docker compose exec -T postgres sh -c \
'psql -U "$POSTGRES_USER" -d brume_restore \
-c "SELECT count(*) FROM schema_migrations;"'Remove the validation database
docker compose exec -T postgres sh -c \
'dropdb -U "$POSTGRES_USER" brume_restore'Resolve an unavailable backend
Symptom → /health fails.
Diagnosis →
docker compose ps
docker compose logs --tail 200 backend postgres
docker compose exec postgres sh -c \
'pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"'Resolution →
docker compose up -d --wait backend
curl -fsS http://localhost:8000/healthResolve stuck tasks
Symptom → processing remains queued.
Diagnosis →
docker compose ps worker
docker compose logs --tail 200 worker backendResolution →
docker compose up -d worker
docker compose logs -f workerCompose upgrades go through the superadmin button, described in Upgrade. For high availability, the PostgreSQL operator, S3 backups, and monitoring, take the Helm chart.
Docker all-in-one
The single ghcr.io/brume-ai/brume image: launch, embedded or external database, s6 service checks, backups, and incidents.
Enterprise on Docker Compose
Deploy the Enterprise stack with Docker Compose: licence, BRUME_EDITION=enterprise, the enterprise profile (Lago + Redis), and its secrets.