Skip to content

Docker Deployment

The repository’s docker-compose.yml runs the whole stack. Services are split into two profiles that share one Postgres:

ServiceProfilePortsNotes
dbalways5432postgres:16-alpine, database bizon_platform, user and password bizon
apiprod8000Runs alembic upgrade head, then the API
workerprodPolls for runs
uiprod3000nginx serving the built UI and proxying /api to api
api-devdev8000Same as api, with uvicorn --reload and ./bizon_platform mounted
worker-devdevRestarts on code changes
ui-devdev5173Vite dev server in node:22, proxying /api to api-dev

All app services mount ./custom_sources at /custom_sources and share the bizon_outputs volume at /tmp/bizon-outputs for logs and outputs.

Terminal window
cp .env.example .env # then set ENCRYPTION_KEY, e.g. from `make key`
make dev # docker compose --profile dev up
make prod # docker compose --profile prod up -d

make prod-build and make dev-build rebuild the images first. make down stops both profiles, and make clean also deletes the volumes, including the database.

Check that it is up:

Terminal window
curl http://localhost:8000/api/health
# {"status":"ok","database":"ok"}

Compose sets DATABASE_URL, STORAGE_LOCAL_PATH and CUSTOM_SOURCES_DIR itself. Every other variable comes from .env, which the api, worker, api-dev and worker-dev services load when it exists. That covers ENCRYPTION_KEY, ADMIN_PASSWORD, the GIT_SYNC_* settings, and the credentials your pipelines read:

.env
ENCRYPTION_KEY=...
ADMIN_PASSWORD=...
GIT_SYNC_ENABLED=true
GIT_SYNC_REPO_URL=https://github.com/acme/bizon-sources.git
GIT_SYNC_TOKEN=...
HUBSPOT_TOKEN=...

See Configuration for every variable.

Each worker runs one pipeline at a time. Run more of them for parallel runs:

Terminal window
docker compose --profile prod up -d --scale worker=4

Workers claim runs with SELECT ... FOR UPDATE SKIP LOCKED, so a run is never picked twice. Keep a single api container: it runs the scheduler.

Terminal window
make logs # every service
docker compose --profile prod logs -f worker

Pipeline run logs are files in the bizon_outputs volume, under logs/<pipeline_id>/<run_id>.log. Read them from the UI or GET /api/pipelines/runs/{run_id}/logs.

Point the services’ DATABASE_URL at your Postgres and drop the db dependency:

DATABASE_URL: postgresql+asyncpg://user:password@db.example.com:5432/bizon_platform

The API runs the migrations on start.

Compose builds images from the repository. CI also publishes multi-arch (amd64 and arm64) images on every push to main, tagged latest and sha-<short sha>:

  • ghcr.io/bizon-data/bizon-platform: API and worker. Start the worker with python -m bizon_platform.worker.
  • ghcr.io/bizon-data/bizon-platform-ui: nginx on port 8080. It proxies /api to http://api:8000.