2023-05-10 09:02:59 +02:00
|
|
|
version: '3.9'
|
|
|
|
|
|
|
|
services:
|
|
|
|
backend:
|
|
|
|
container_name: "${APP_NAME}-backend"
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: deployment/Dockerfile
|
|
|
|
args:
|
|
|
|
- APP_NAME=${APP_NAME}
|
|
|
|
- APP_HOST=${APP_HOST}
|
|
|
|
- APP_PORT=${APP_PORT}
|
|
|
|
volumes:
|
|
|
|
- ./src:/usr/src/app/
|
|
|
|
- ./deployment/scripts:/app/deployment/scripts/
|
2023-05-10 09:11:23 +02:00
|
|
|
env_file: .env
|
2023-05-10 13:19:19 +02:00
|
|
|
ports:
|
|
|
|
- "${APP_PORT}:${APP_PORT}"
|
2023-05-10 12:09:50 +02:00
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
- redis
|
2023-05-10 09:02:59 +02:00
|
|
|
command: [ "/bin/sh", "/app/deployment/scripts/backend/start.sh" ]
|
|
|
|
|
|
|
|
db:
|
|
|
|
image: postgres:15.2-alpine
|
|
|
|
container_name: "${APP_NAME}-db"
|
|
|
|
hostname: "${POSTGRES_HOST:-db}"
|
|
|
|
volumes:
|
|
|
|
- postgres_data_dir:/var/lib/postgresql/data/
|
2023-05-10 09:11:23 +02:00
|
|
|
env_file: .env
|
2023-05-10 13:19:19 +02:00
|
|
|
expose:
|
|
|
|
- "${POSTGRES_PORT:-5432}"
|
2023-05-10 09:02:59 +02:00
|
|
|
shm_size: 1g
|
2023-05-10 12:09:50 +02:00
|
|
|
|
2023-05-10 09:02:59 +02:00
|
|
|
|
|
|
|
redis:
|
|
|
|
container_name: "${APP_NAME}-redis"
|
|
|
|
image: redis:latest
|
|
|
|
volumes:
|
|
|
|
- redis_data:/data
|
|
|
|
|
|
|
|
celery-worker: &celery-worker
|
|
|
|
container_name: "${APP_NAME}-celery-worker"
|
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: deployment/Dockerfile
|
|
|
|
volumes:
|
|
|
|
- ./src:/usr/src/app/
|
|
|
|
- ./deployment/scripts:/app/deployment/scripts/
|
2023-05-10 09:11:23 +02:00
|
|
|
env_file: .env
|
2023-05-10 09:02:59 +02:00
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
- redis
|
|
|
|
- backend
|
|
|
|
command: [ "/bin/sh", "/app/deployment/scripts/celery/start-worker.sh" ]
|
|
|
|
|
|
|
|
celery-beat:
|
|
|
|
<<: *celery-worker
|
|
|
|
container_name: "${APP_NAME}-celery-beat"
|
|
|
|
command: [ "/bin/sh", "/app/deployment/scripts/celery/start-beat.sh" ]
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
postgres_data_dir:
|
|
|
|
redis_data:
|