agenda_culturel/docker-compose.yml

72 lines
1.7 KiB
YAML
Raw Normal View History

2023-11-15 12:01:35 +01:00
version: '3.7'
2023-05-10 09:02:59 +02:00
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}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
2023-05-10 09:02:59 +02:00
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:
2023-05-10 21:48:56 +02:00
db:
condition: service_healthy
command: [ "/bin/bash", "/app/deployment/scripts/backend/start.sh" ]
2023-05-10 09:02:59 +02:00
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 21:48:56 +02:00
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
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
2023-05-10 09:02:59 +02:00
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/bash", "/app/deployment/scripts/celery/start-worker.sh" ]
2023-05-10 09:02:59 +02:00
celery-beat:
<<: *celery-worker
container_name: "${APP_NAME}-celery-beat"
command: [ "/bin/bash", "/app/deployment/scripts/celery/start-beat.sh" ]
2023-05-10 09:02:59 +02:00
volumes:
postgres_data_dir:
redis_data: