2024-12-12 22:12:00 +03:00
|
|
|
volumes:
|
|
|
|
db_data: {}
|
|
|
|
batcher_db_data: {}
|
2024-12-16 19:13:27 +03:00
|
|
|
backend_media: {}
|
2024-12-17 16:48:36 +03:00
|
|
|
backend_static: {}
|
2024-12-12 22:12:00 +03:00
|
|
|
|
|
|
|
services:
|
|
|
|
backend:
|
|
|
|
build:
|
|
|
|
context: ./backend
|
|
|
|
volumes:
|
2024-12-16 19:13:27 +03:00
|
|
|
- backend_media:/app/media
|
2024-12-17 16:48:36 +03:00
|
|
|
- backend_static:/app/static
|
2024-12-16 19:13:27 +03:00
|
|
|
command: /app/scripts/gunicorn.sh
|
2024-12-12 22:12:00 +03:00
|
|
|
restart: on-failure
|
|
|
|
depends_on:
|
2024-12-16 19:13:27 +03:00
|
|
|
postgres: &healthy-dependency
|
|
|
|
condition: service_healthy
|
|
|
|
rabbitmq: *healthy-dependency
|
|
|
|
env_file: &backend-env-files
|
2024-12-12 22:12:00 +03:00
|
|
|
- .env/prod/pg
|
|
|
|
- .env/prod/back
|
|
|
|
- .env/prod/rmq
|
|
|
|
- .env/prod/bot
|
2024-12-14 08:52:01 +03:00
|
|
|
- .env/prod/web
|
2024-12-12 22:12:00 +03:00
|
|
|
|
|
|
|
bot:
|
2024-12-16 19:13:27 +03:00
|
|
|
build: ./bot
|
2024-12-12 22:12:00 +03:00
|
|
|
depends_on:
|
2024-12-16 19:13:27 +03:00
|
|
|
backend: &started-dependency
|
|
|
|
condition: service_started
|
|
|
|
batcher: *started-dependency
|
2024-12-12 22:12:00 +03:00
|
|
|
env_file:
|
|
|
|
- .env/prod/bot
|
2024-12-14 01:37:54 +03:00
|
|
|
- .env/prod/web
|
2024-12-16 19:13:27 +03:00
|
|
|
command: /app/scripts/gunicorn.sh
|
2024-12-12 22:12:00 +03:00
|
|
|
restart: on-failure
|
2024-12-14 08:52:01 +03:00
|
|
|
|
2024-12-16 19:13:27 +03:00
|
|
|
postgres: &pg-conf
|
|
|
|
image: postgres:17-alpine
|
2024-12-12 22:12:00 +03:00
|
|
|
volumes:
|
|
|
|
- db_data:/var/lib/postgresql/data
|
|
|
|
env_file:
|
|
|
|
- .env/prod/pg
|
2024-12-16 19:13:27 +03:00
|
|
|
user: postgres
|
|
|
|
healthcheck: &pg-healthcheck
|
|
|
|
test: [ "CMD-SHELL", "pg_isready" ]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 2s
|
|
|
|
retries: 5
|
2024-12-12 22:12:00 +03:00
|
|
|
|
|
|
|
nginx:
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: nginx/Dockerfile
|
|
|
|
ports:
|
|
|
|
- '80:80'
|
|
|
|
- '443:443'
|
|
|
|
depends_on:
|
2024-12-16 19:13:27 +03:00
|
|
|
bot: *started-dependency
|
2024-12-12 22:12:00 +03:00
|
|
|
volumes:
|
2024-12-17 16:48:36 +03:00
|
|
|
- backend_static:/static/
|
2024-12-21 11:53:35 +03:00
|
|
|
- backend_media:/media/
|
2024-12-12 22:12:00 +03:00
|
|
|
restart: unless-stopped
|
|
|
|
|
|
|
|
celery:
|
|
|
|
build: ./backend
|
2024-12-16 19:13:27 +03:00
|
|
|
command: /app/scripts/start_celery.sh
|
|
|
|
env_file: *backend-env-files
|
|
|
|
environment:
|
|
|
|
- CELERY_WORKER_COUNT=10
|
2024-12-12 22:12:00 +03:00
|
|
|
depends_on:
|
2024-12-16 19:13:27 +03:00
|
|
|
backend: *started-dependency
|
2024-12-12 22:12:00 +03:00
|
|
|
|
|
|
|
rabbitmq:
|
|
|
|
container_name: 'rabbitmq'
|
|
|
|
image: 'rabbitmq:3-management-alpine'
|
|
|
|
env_file:
|
|
|
|
- .env/prod/rmq
|
2024-12-16 19:13:27 +03:00
|
|
|
healthcheck:
|
|
|
|
<<: *pg-healthcheck
|
|
|
|
test: rabbitmq-diagnostics -q ping
|
|
|
|
interval: 10s
|
|
|
|
timeout: 2s
|
2024-12-12 22:12:00 +03:00
|
|
|
|
|
|
|
batcher:
|
2024-12-16 19:13:27 +03:00
|
|
|
build: ./batcher
|
2024-12-12 22:12:00 +03:00
|
|
|
depends_on:
|
2024-12-16 19:13:27 +03:00
|
|
|
batcher-postgres: *healthy-dependency
|
|
|
|
rabbitmq: *healthy-dependency
|
2024-12-12 22:12:00 +03:00
|
|
|
env_file:
|
|
|
|
- .env/prod/rmq
|
|
|
|
- .env/prod/batcher-pg
|
|
|
|
- .env/prod/batcher
|
|
|
|
- .env/prod/bot
|
|
|
|
|
|
|
|
batcher-postgres:
|
2024-12-16 19:13:27 +03:00
|
|
|
<<: *pg-conf
|
2024-12-12 22:12:00 +03:00
|
|
|
volumes:
|
|
|
|
- batcher_db_data:/var/lib/postgresql/data
|
|
|
|
env_file:
|
|
|
|
- .env/prod/batcher-pg
|