99 lines
2.0 KiB
YAML
99 lines
2.0 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: training
|
|
POSTGRES_USER: training
|
|
POSTGRES_PASSWORD: training
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U training"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
args:
|
|
REQUIREMENTS_FILE: local.txt
|
|
command: python manage.py runserver 0.0.0.0:8000
|
|
volumes:
|
|
- .:/app
|
|
ports:
|
|
- "8000:8000"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: config.settings.local
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
celery:
|
|
build:
|
|
context: .
|
|
args:
|
|
REQUIREMENTS_FILE: local.txt
|
|
command: celery -A config worker --loglevel=info
|
|
volumes:
|
|
- .:/app
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: config.settings.local
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
celery-beat:
|
|
build:
|
|
context: .
|
|
args:
|
|
REQUIREMENTS_FILE: local.txt
|
|
command: celery -A config beat --loglevel=info --scheduler django_celery_beat.schedulers:DatabaseScheduler
|
|
volumes:
|
|
- .:/app
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DJANGO_SETTINGS_MODULE: config.settings.local
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: frontend/Dockerfile
|
|
depends_on:
|
|
- web
|
|
environment:
|
|
FRONTEND_API_BASE_URL: ${FRONTEND_API_BASE_URL:-http://localhost:8000}
|
|
ports:
|
|
- "${FRONTEND_PORT:-8080}:80"
|
|
|
|
volumes:
|
|
postgres_data:
|