108 lines
2.6 KiB
YAML
108 lines
2.6 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
|
|
|
|
status:
|
|
build:
|
|
context: ./status-service
|
|
dockerfile: Dockerfile
|
|
container_name: marathon-status
|
|
environment:
|
|
BACKEND_URL: http://backend:8000
|
|
FRONTEND_URL: http://frontend:80
|
|
BOT_URL: http://bot:8080
|
|
CHECK_INTERVAL: "30"
|
|
ports:
|
|
- "8001:8001"
|
|
depends_on:
|
|
- backend
|
|
- frontend
|
|
- bot
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|