Skip to main content

Deploy with Docker

ZAR ships a Dockerfile based on python:3.12-slim. It installs the system libraries tree-sitter and cryptography need, then runs the FastAPI app with uvicorn.

Build

Run

Pass configuration as environment variables. The private key is easiest to inject inline:
The container serves on port 8000 (uvicorn app.main:app --host 0.0.0.0 --port 8000). Put it behind a TLS-terminating reverse proxy and point your GitHub App’s Webhook URL at https://YOUR_DOMAIN/github/webhook. By default this uses SQLite inside the container, which is ephemeral — fine for a trial, not for production. For anything real, mount a volume or use Postgres (below).

docker-compose

The repo includes a docker-compose.yml with a Redis service. A practical compose setup adds Postgres and your env file:
Run it:
Keep secrets in .env (referenced via env_file) and never commit it.

Persistence & scaling

  • Use Postgres for production; SQLite in a container is lost on redeploy unless you mount a volume.
  • If you run more than one ZAR replica, add a shared lock so replicas don’t double-process a repo’s events. See the scaling note.

Verify

Next steps