refactor
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2026-02-17 00:22:42 +09:00
parent ca0c63a89c
commit 0fdad07d82
36 changed files with 4384 additions and 368 deletions

View File

@@ -2,6 +2,41 @@
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: lottery_postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-lottery_bot}
POSTGRES_USER: ${POSTGRES_USER:-lottery_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-lottery_password}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- lottery_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lottery_user}"]
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:
@@ -12,15 +47,18 @@ services:
env_file:
- .env.prod
environment:
- DATABASE_URL=${DATABASE_URL}
- BOT_TOKEN=${BOT_TOKEN}
- ADMIN_IDS=${ADMIN_IDS}
- 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
@@ -31,6 +69,10 @@ services:
volumes:
bot_data:
driver: local
postgres_data:
driver: local
redis_data:
driver: local
networks:
lottery_network: