db_kyc_project/docker-compose-prod.yml

103 lines
2.2 KiB
YAML
Raw Normal View History

2024-12-12 22:12:00 +03:00
volumes:
db_data: {}
batcher_db_data: {}
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:
- backend_media:/app/media
2024-12-17 16:48:36 +03:00
- backend_static:/app/static
2025-05-31 16:15:06 +03:00
command: /app/scripts/prod.sh
2024-12-12 22:12:00 +03:00
restart: on-failure
depends_on:
postgres: &healthy-dependency
condition: service_healthy
rabbitmq: *healthy-dependency
env_file: &backend-env-files
- .env/dev/pg
- .env/dev/back
- .env/dev/rmq
- .env/dev/bot_token
- .env/dev/web
2024-12-12 22:12:00 +03:00
bot:
build: ./bot
2024-12-12 22:12:00 +03:00
depends_on:
backend: &started-dependency
condition: service_started
batcher: *started-dependency
2024-12-12 22:12:00 +03:00
env_file:
- .env/dev/bot
- .env/dev/bot_token
- .env/dev/web
2025-05-31 16:15:06 +03:00
command: /app/scripts/prod.sh
2024-12-12 22:12:00 +03:00
restart: on-failure
2024-12-14 08:52:01 +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/dev/pg
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:
2025-06-09 14:40:19 +03:00
- '80:8081'
2024-12-12 22:12:00 +03:00
depends_on:
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
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:
backend: *started-dependency
2024-12-12 22:12:00 +03:00
rabbitmq:
container_name: 'rabbitmq'
image: 'rabbitmq:3-management-alpine'
env_file:
- .env/dev/rmq
healthcheck:
<<: *pg-healthcheck
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 2s
2024-12-12 22:12:00 +03:00
batcher:
build: ./batcher
2024-12-12 22:12:00 +03:00
depends_on:
batcher-postgres: *healthy-dependency
rabbitmq: *healthy-dependency
2024-12-12 22:12:00 +03:00
env_file:
- .env/dev/rmq
- .env/dev/batcher-pg
- .env/dev/batcher
- .env/dev/bot_token
2024-12-12 22:12:00 +03:00
batcher-postgres:
<<: *pg-conf
2024-12-12 22:12:00 +03:00
volumes:
- batcher_db_data:/var/lib/postgresql/data
env_file:
- .env/dev/batcher-pg