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:
- Pull latest code.
- Build images.
- Start Postgres + Redis.
- Run SQL migrations (
scripts/migrate.sh). - 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:8443orhttps://admin.ft.farm). - Protect admin endpoint with
basic authand/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¶
- Switch nginx upstream back to previous target.
docker compose ... downand bring up previous image set.- Validate health endpoints and logs.