Skip to content

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.

    → Learn More

  • Production Checklist


    Complete checklist for production deployment.

    → Learn More

  • CI/CD


    Continuous integration and deployment.

    → Learn More

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

docker compose build
docker compose up -d

3. Run Migrations

docker compose exec api python manage.py migrate

4. Verify

curl http://localhost:8009/v1/health

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