Files
new_lottery_bot/docker-compose.yml
Lottery Bot Admin 4daec268e6
All checks were successful
continuous-integration/drone/push Build is passing
Update production configuration
- Update BOT_TOKEN for production environment
- Configure external PostgreSQL host (192.168.0.102)
- Update database connection details (new_lottery_KR)
- Adjust docker-compose configuration for production setup
- Set LOG_LEVEL to DEBUG for better diagnostics
2026-03-07 00:06:01 +00:00

80 lines
1.8 KiB
YAML

# Docker Compose для продакшн-развертывания
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: lottery_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-new_lottery_kr}
POSTGRES_USER: ${POSTGRES_USER:-trevor}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-Cl0ud_1985!}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- lottery_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-trevor}"]
interval: 10s
timeout: 5s
retries: 5
# Redis для очередей рассылки
redis:
image: redis:7-alpine
container_name: lottery_redis
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis_data:/data
networks:
- lottery_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# Telegram Bot
bot:
build:
context: .
dockerfile: Dockerfile
container_name: lottery_bot
restart: unless-stopped
env_file:
- .env.prod
environment:
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
volumes:
- ./logs:/app/logs
- bot_data:/app/data
networks:
- lottery_network
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
bot_data:
driver: local
postgres_data:
driver: local
redis_data:
driver: local
networks:
lottery_network:
driver: bridge