Deployment¶
This project was generated with the following deployment-related flags:
- ✅ Docker /
docker-compose.yml - ❌ No Kubernetes manifests
- CI:
github - Reverse proxy: Nginx
Docker Compose (single host)¶
For staging or small production:
# 1. Configure
cp backend/.env.example backend/.env
# Edit backend/.env with production values (see configuration.md)
# 2. Build + start
docker compose up -d --build
# 3. Apply migrations
docker compose exec app uv run alembic upgrade head
# 4. Verify
curl http://localhost:8000/api/v1/health
# Frontend: http://localhost:3000
Reverse proxy¶
Nginx config in nginx/ proxies / → frontend, /api → backend, /ws → backend WebSocket. Update server_name and TLS cert paths in nginx/conf.d/app.conf.
Platform-specific quickstarts¶
Fly.io¶
fly launch --name agenticos-backend --region waw
fly postgres create --name agenticos-db
fly postgres attach agenticos-db
# Redis: use Upstash (`fly redis create`) or Fly's Tigris
fly secrets set $(cat backend/.env | grep -v '^#' | xargs)
fly deploy
Railway¶
- Connect repo, pick Dockerfile-based deploy.
- Add env vars from
backend/.envto Railway service. - Provision PostgreSQL plugin →
DATABASE_URLauto-injected. - Provision Redis plugin →
REDIS_URLauto-injected. - Deploy.
Render¶
- Create Web Service → docker, point at
backend/Dockerfile. - Create Static Site for frontend (build cmd:
bun install && bun run build, output dir:.next). - Create PostgreSQL → copy DATABASE_URL.
- Add env vars; deploy.
Vercel (frontend only)¶
The frontend is a Next.js app — works on Vercel out of the box.
Set BACKEND_URL and NEXT_PUBLIC_API_URL env vars in Vercel dashboard pointing to your backend host.
Environment validation in production¶
Before promoting to prod, run:
Catches missing required env vars early. See Configuration for the full list.
Post-deploy checks¶
- [ ]
/api/v1/healthreturns{"status": "ok"} - [ ]
alembic currentmatches expected revision - [ ] Frontend renders, login flow works end-to-end
- [ ] Test email sends (trigger password-reset flow)
- [ ] Logs flowing to your aggregator + Logfire receiving traces
- [ ] Reverse proxy enforces HTTPS
Rollback¶
- Schema:
alembic downgrade -1rolls back one migration. Test on staging first. - Code: redeploy previous image tag. Pin tags (
v1.2.3), never deploylatestto prod. - Data: restore from your most recent backup; verify
alembic currentmatches the data version.