agenda_culturel/docker-compose.prod.yml

88 lines
2.2 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}
volumes:
- ./src:/usr/src/app/
- ./deployment/scripts:/app/deployment/scripts/
2023-05-10 12:09:50 +02:00
- static_files:/usr/src/app/static
2023-05-10 13:19:19 +02:00
- media_files:/usr/src/app/media
2023-11-15 12:01:35 +01:00
env_file: .env.prod
2023-05-10 13:19:19 +02:00
expose:
- "${APP_PORT:-8000}"
2023-05-10 09:02:59 +02:00
depends_on:
2023-11-15 12:01:35 +01:00
- db
command: [ "/bin/bash", "/app/deployment/scripts/wait-db.sh", "/app/deployment/scripts/backend/start.sh" ]
2023-05-10 09:02:59 +02:00
db:
2024-10-10 23:45:49 +02:00
image: postgis/postgis:15-3.4-alpine
2023-05-10 09:02:59 +02:00
container_name: "${APP_NAME}-db"
hostname: "${POSTGRES_HOST:-db}"
volumes:
- postgres_data_dir:/var/lib/postgresql/data/
2023-11-15 12:01:35 +01:00
env_file: .env.prod
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
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/
- static_files:/usr/src/app/static
- media_files:/usr/src/app/media
2023-11-15 12:01:35 +01:00
env_file: .env.prod
2023-05-10 09:02:59 +02:00
depends_on:
- db
- redis
- backend
command: [ "/bin/bash", "/app/deployment/scripts/wait-db.sh", "/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/wait-db.sh", "/app/deployment/scripts/celery/start-beat.sh" ]
2023-05-10 09:02:59 +02:00
2023-05-10 12:09:50 +02:00
nginx:
image: nginx:latest
container_name: "${APP_NAME}-nginx"
volumes:
- ./deployment/scripts/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- static_files:/usr/src/app/static
2023-05-10 13:19:19 +02:00
- media_files:/usr/src/app/media
2023-11-15 12:01:35 +01:00
env_file: .env.prod
ports:
- 6380:80
2023-05-10 12:09:50 +02:00
depends_on:
2023-05-10 16:33:37 +02:00
- backend
2023-05-10 09:02:59 +02:00
volumes:
2023-05-10 12:09:50 +02:00
static_files:
2023-05-10 13:19:19 +02:00
media_files:
2023-05-10 09:02:59 +02:00
postgres_data_dir:
2023-05-10 12:09:50 +02:00
redis_data: