Docker Deployment
PolySimulator provides Docker images for production deployment with full orchestration via Docker Compose.Quick Start
Architecture
Docker Compose Configuration
The production compose file starts four services:| Service | Image | Port | Purpose |
|---|---|---|---|
backend | Custom | 8000 | FastAPI API server |
frontend | Custom | 3000 | Next.js web UI |
db | postgres:16 | 5432 | PostgreSQL database |
redis | redis:7-alpine | 6379 | Price cache |
If you use Supabase for your database, you can omit the
db service and point DATABASE_URL at your Supabase project.Building Images
Container Startup
The backend container runsdocker-entrypoint.sh which:
- Waits for PostgreSQL to be ready
- Runs Alembic migrations (
alembic upgrade head) - Starts uvicorn with production settings
Health Checks
Docker Compose includes health checks for all services:Scaling
For higher throughput, run multiple backend workers:Updating
Next Steps
- Monitoring — Prometheus metrics and health endpoints
- Live Migration — Switch from virtual to live trading