121 lines
2.8 KiB
YAML
121 lines
2.8 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: bttoxin_postgres
|
|
environment:
|
|
POSTGRES_USER: bttoxin
|
|
POSTGRES_PASSWORD: bttoxin_password
|
|
POSTGRES_DB: bttoxin_db
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U bttoxin"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: bttoxin_redis
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
api:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
container_name: bttoxin_api
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
volumes:
|
|
- ../backend:/app
|
|
- ../data:/data
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://bttoxin:bttoxin_password@postgres:5432/bttoxin_db
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- WORKSPACE_BASE_PATH=/data/jobs
|
|
- DEBUG=True
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
worker:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
container_name: bttoxin_worker
|
|
command: celery -A app.core.celery_app worker --loglevel=info --concurrency=2
|
|
volumes:
|
|
- ../backend:/app
|
|
- ../data:/data
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
environment:
|
|
- DATABASE_URL=postgresql://bttoxin:bttoxin_password@postgres:5432/bttoxin_db
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- WORKSPACE_BASE_PATH=/data/jobs
|
|
- C_FORCE_ROOT=true
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
restart: unless-stopped
|
|
|
|
beat:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
container_name: bttoxin_beat
|
|
command: celery -A app.core.celery_app beat --loglevel=info
|
|
volumes:
|
|
- ../backend:/app
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379/0
|
|
depends_on:
|
|
- redis
|
|
restart: unless-stopped
|
|
|
|
flower:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: Dockerfile
|
|
container_name: bttoxin_flower
|
|
command: celery -A app.core.celery_app flower --port=5555
|
|
ports:
|
|
- "5555:5555"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379/0
|
|
depends_on:
|
|
- redis
|
|
restart: unless-stopped
|
|
|
|
frontend:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/frontend/Dockerfile
|
|
container_name: bttoxin_frontend
|
|
ports:
|
|
- "3000:80"
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data: |