Skip to content

Deployment

Files

  • Base compose (dev-like): docker/docker-compose.yml
  • Staging/production compose: docker/docker-compose.staging.yml
  • Prod overrides: docker/docker-compose.prod.yml
  • Host nginx template: docker/nginx.host.conf
  • Deploy helper: scripts/deploy.sh

Staging flow

cp docker/staging.env.example .env.staging
# fill secrets
bash scripts/deploy.sh

scripts/deploy.sh does:

  1. Pull latest code.
  2. Build images.
  3. Start Postgres + Redis.
  4. Run SQL migrations (scripts/migrate.sh).
  5. Start all services.

Admin panel isolation

Admin panel is a separate service (ft.admin_panel.app:app) and must stay isolated from the public portal routing.

Recommended ingress pattern:

  • Main site on https://ft.farm -> portal service.
  • Admin panel on a dedicated endpoint (example: https://ft.farm:8443 or https://admin.ft.farm).
  • Protect admin endpoint with basic auth and/or IP allowlist.

Do not mount admin panel on the same public root path as the main site.

Health checks

  • API: GET /health, GET /health/ready
  • Admin panel: GET /health

Rollback

  1. Switch nginx upstream back to previous target.
  2. docker compose ... down and bring up previous image set.
  3. Validate health endpoints and logs.