Stabilize staff concurrency and premium emoji; enable verified Drone deployment
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,27 +1,22 @@
|
||||
# Docker Compose для продакшн-развертывания
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# PostgreSQL Database
|
||||
# Enable COMPOSE_PROFILES=local-db only when PostgreSQL is hosted in this stack.
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: lottery_postgres
|
||||
profiles: [local-db]
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-new_lottery_kr}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-trevor}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-Cl0ud_1985!}
|
||||
POSTGRES_DB: ${POSTGRES_DB:-lottery_bot}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-lottery_bot}
|
||||
# PostgreSQL itself rejects an empty password when local-db is enabled.
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- lottery_network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-trevor}"]
|
||||
interval: 10s
|
||||
test: [CMD-SHELL, 'pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 20
|
||||
|
||||
# Redis для очередей рассылки
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: lottery_redis
|
||||
@@ -29,51 +24,35 @@ services:
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- lottery_network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
test: [CMD, redis-cli, ping]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
retries: 20
|
||||
|
||||
# Telegram Bot
|
||||
bot:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: ${BOT_IMAGE:-new_lottery_bot:local}
|
||||
build: .
|
||||
container_name: lottery_bot
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env.prod
|
||||
init: true
|
||||
env_file: .env.prod
|
||||
environment:
|
||||
- LOG_LEVEL=${LOG_LEVEL:-INFO}
|
||||
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
|
||||
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
|
||||
stop_grace_period: 45s
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
test: [CMD, python, -m, src.core.health]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 4
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
bot_data:
|
||||
driver: local
|
||||
postgres_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
lottery_network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user