41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: language_bot_db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-botuser}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-botpassword}
|
|
POSTGRES_DB: ${POSTGRES_DB:-language_bot}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "${DB_PORT:-15433}:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-botuser}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
bot:
|
|
build: .
|
|
container_name: language_bot
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
BOT_TOKEN: ${BOT_TOKEN}
|
|
OPENAI_API_KEY: ${OPENAI_API_KEY}
|
|
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-botuser}:${POSTGRES_PASSWORD:-botpassword}@db:5432/${POSTGRES_DB:-language_bot}
|
|
DEBUG: ${DEBUG:-False}
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
env_file:
|
|
- .env
|
|
|
|
volumes:
|
|
postgres_data:
|