Docker Compose v2
Last updated: 2026-03-13 · Related task: P1-OPS-001
This page explains how to run the FastAPI API, Celery worker and beat, PostgreSQL, Redis, and the React SPA locally with Docker Compose.
If you only want to run the product rather than develop the repository, prefer
docker-compose.ghcr.yml. It pulls prebuilt images from GHCR instead of building locally.
Layout
Environment Variables
Compose ships with predictable local defaults, so docker compose up --build can work even before
you create .env.
These defaults are fine for a disposable demo, but they are not appropriate once you start storing real provider keys.
Recommended setup:
Other common defaults:
REDIS_URL=redis://redis:6379/0CELERY_BROKER_URLandCELERY_RESULT_BACKENDfall back to Redis- provider credentials are managed in the application UI, not injected through environment variables
docker-compose.build.ymlcan be used when CI only needs image builds
For integration tests, scripts/tests/run_docker_integration.sh bootstraps .env.integration
from .env.integration.example when needed.
Starting the Full Stack
This starts:
- FastAPI API on port
8000 - Celery worker and beat
- PostgreSQL and Redis
- the React SPA on port
5173
Backend-only mode
If you only need the backend services:
Local hot-reload development
For frontend hot reload, copy the override template:
That override mounts the local frontend/ directory into the container. It is intended for local
development only and stays ignored by git.
Persistence
- PostgreSQL data is stored in the
pgdatavolume - Redis data is stored in the
redisdatavolume
Common Commands
Operational Notes
- Images build with
uv sync --frozenso dependency resolution stays aligned withuv.lock. - Replace any demo passwords before storing real provider credentials.
- Provider keys should come from the app UI, Compose
.env, or an external secret manager, never from baked image layers. - Containers run as the non-root
eval752user by default. ENCRYPTION_KEYis mandatory. The demo value is only for first boot convenience.- On startup, the backend entrypoint runs
python -m eval_752.scripts.check_database. If it reportspassword authentication failed, your existingpgdatalikely belongs to a different password. Restore the old password or reset withdocker compose down -v. - The frontend defaults to
/api, and the frontend container proxies/api/*tobackend:8000, which keeps same-origin deployment simple. - If the frontend must call another backend origin, set
VITE_API_BASE_URL=https://api.example.comand rebuild the frontend image. - On slow networks or ARM hosts, large wheel downloads may need a higher timeout:
UV_HTTP_TIMEOUT=600 docker compose build backend
Prometheus Scraping
The backend exposes /metrics. A minimal Prometheus scrape config looks like this:
If you expose the service through a reverse proxy or Kubernetes ingress, adjust the scrape target accordingly.
Related docs:
