Files
game-marathon/docker-compose.yml
2025-12-16 20:06:16 +07:00

90 lines
2.2 KiB
YAML

services:
db:
image: postgres:15-alpine
container_name: marathon-db
environment:
POSTGRES_USER: marathon
POSTGRES_PASSWORD: ${DB_PASSWORD:-marathon}
POSTGRES_DB: marathon
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U marathon"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: marathon-backend
environment:
DATABASE_URL: postgresql+asyncpg://marathon:${DB_PASSWORD:-marathon}@db:5432/marathon
SECRET_KEY: ${SECRET_KEY:-change-me-in-production}
OPENAI_API_KEY: ${OPENAI_API_KEY}
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_BOT_USERNAME: ${TELEGRAM_BOT_USERNAME:-GameMarathonBot}
DEBUG: ${DEBUG:-false}
# S3 Storage
S3_ENABLED: ${S3_ENABLED:-false}
S3_BUCKET_NAME: ${S3_BUCKET_NAME:-}
S3_REGION: ${S3_REGION:-ru-1}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-}
S3_ENDPOINT_URL: ${S3_ENDPOINT_URL:-}
S3_PUBLIC_URL: ${S3_PUBLIC_URL:-}
volumes:
- ./backend/uploads:/app/uploads
- ./backend/app:/app/app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-/api/v1}
container_name: marathon-frontend
ports:
- "3000:80"
depends_on:
- backend
restart: unless-stopped
nginx:
image: nginx:alpine
container_name: marathon-nginx
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./backend/uploads:/app/uploads:ro
depends_on:
- frontend
- backend
restart: unless-stopped
bot:
build:
context: ./bot
dockerfile: Dockerfile
container_name: marathon-bot
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- API_URL=http://backend:8000
depends_on:
- backend
restart: unless-stopped
volumes:
postgres_data: