/
Codename-Nik
/
WebApp
Обзор
Документация
Войти
/
Codename-Nik
/
WebApp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docker-compose.production.yml
100 строк
2 KB
Nikolay Pokhodnya
first commit
03 ноя 2025, 19:47
03 ноя 2025, 19:47
a9fbdee
Код
Авторство
О чём код?
version: '3.8' services: db: image: postgres:15-alpine environment: POSTGRES_DB: ${POSTGRES_DB:-taskflow_prod} POSTGRES_USER: ${POSTGRES_USER:-taskflow_user} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change_this_password} volumes: - postgres_data:/var/lib/postgresql/data - ./backups:/backups restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-taskflow_user}"] interval: 30s timeout: 10s retries: 3 redis: image: redis:7-alpine restart: unless-stopped command: redis-server --appendonly yes volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 3 backend: build: context: . dockerfile: Dockerfile.production environment: - DEBUG=${DEBUG:-False} - SECRET_KEY=${SECRET_KEY} - ALLOWED_HOSTS=${ALLOWED_HOSTS} - POSTGRES_DB=${POSTGRES_DB:-taskflow_prod} - POSTGRES_USER=${POSTGRES_USER:-taskflow_user} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_HOST=db - POSTGRES_PORT=5432 - REDIS_HOST=redis - REDIS_PORT=6379 volumes: - static_volume:/app/staticfiles - media_volume:/app/mediafiles depends_on: db: condition: service_healthy redis: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/api/health/"] interval: 30s timeout: 10s retries: 3 frontend: build: context: ./frontend dockerfile: Dockerfile.production ports: - "80:80" depends_on: - backend restart: unless-stopped healthcheck: test: ["CMD", "curl", "-f", "http://localhost:80"] interval: 30s timeout: 10s retries: 3 nginx: image: nginx:alpine ports: - "443:443" - "80:80" volumes: - ./nginx/conf.d:/etc/nginx/conf.d - ./nginx/ssl:/etc/nginx/ssl - static_volume:/static - media_volume:/media depends_on: - backend - frontend restart: unless-stopped volumes: postgres_data: redis_data: static_volume: media_volume: networks: default: name: taskflow_network