Deployment¶
Deploy your application to production.
Overview¶
The template includes Docker Compose configuration for production deployment.
Architecture¶
┌─────────────────────────────────────────────────────────┐
│ Load Balancer │
└────────────────────────┬────────────────────────────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌────▼────┐ ┌───▼───┐ ┌────▼────┐
│ API │ │ Bot │ │ Worker │
│ (HTTP) │ │(Tele) │ │(Celery) │
└────┬────┘ └───┬───┘ └────┬────┘
│ │ │
└─────────────┼─────────────┘
│
┌──────────────┼──────────────┐
│ │ │
┌────▼────┐ ┌────▼────┐ ┌────▼────┐
│PgBouncer│ │ Redis │ │ MinIO │
└────┬────┘ └─────────┘ └─────────┘
│
┌────▼────┐
│ Postgres│
└─────────┘
Topics¶
-
Docker Compose
Container orchestration and service configuration.
-
Production Checklist
Complete checklist for production deployment.
-
CI/CD
Continuous integration and deployment.
Quick Deploy¶
1. Configure Environment¶
Create .env with production values:
ENVIRONMENT=production
DJANGO_DEBUG=false
DJANGO_SECRET_KEY=<generate-secure-key>
JWT_SECRET_KEY=<generate-secure-key>
# ... other settings
2. Build and Start¶
3. Run Migrations¶
4. Verify¶
Services¶
| Service | Port | Description |
|---|---|---|
| API | 8009 | HTTP API (Gunicorn) |
| Bot | — | Telegram bot (polling) |
| Celery Worker | — | Background tasks |
| Celery Beat | — | Task scheduler |
| PgBouncer | — | Connection pool |
| PostgreSQL | — | Database |
| Redis | — | Cache/Broker |
| MinIO | 9000, 9001 | Object storage |
Related Topics¶
- Environment Variables — All settings
- Production Configuration — Security settings