2024-08-31 14:50:48 +02:00
|
|
|
services:
|
|
|
|
|
|
|
|
postgresql:
|
|
|
|
image: postgres:16
|
|
|
|
container_name: ${PROJECT_NAME}-postgresql
|
|
|
|
restart: ${RESTART_POLICY}
|
|
|
|
env_file: .env
|
|
|
|
environment:
|
2024-09-01 21:36:14 +02:00
|
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
2024-09-01 21:55:39 +02:00
|
|
|
volumes:
|
|
|
|
- ./data_postgresql:/var/lib/postgresql/data
|
2024-09-01 21:36:14 +02:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 60s
|
|
|
|
retries: 5
|
2024-08-31 14:50:48 +02:00
|
|
|
expose:
|
|
|
|
- 5432
|
|
|
|
|
|
|
|
django:
|
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
dockerfile: ./Dockerfiles/django/Dockerfile
|
|
|
|
container_name: ${PROJECT_NAME}-django
|
|
|
|
restart: ${RESTART_POLICY}
|
|
|
|
entrypoint: /django-launcher.sh
|
|
|
|
volumes:
|
|
|
|
- .:/usr/src/app/
|
|
|
|
env_file: .env
|
|
|
|
expose:
|
|
|
|
- 8000
|
|
|
|
depends_on:
|
|
|
|
- postgresql
|
|
|
|
- redis
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
image: nginx:alpine
|
|
|
|
restart: ${RESTART_POLICY}
|
|
|
|
env_file: .env
|
|
|
|
ports:
|
|
|
|
- 8000:80
|
|
|
|
volumes:
|
2024-09-01 21:40:23 +02:00
|
|
|
- ./static:/usr/share/nginx/html/static
|
|
|
|
- ./media:/usr/share/nginx/html/media
|
2024-08-31 14:50:48 +02:00
|
|
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
|
|
|
depends_on:
|
|
|
|
- django
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
restart: ${RESTART_POLICY}
|
|
|
|
container_name: ${PROJECT_NAME}-redis
|
|
|
|
env_file: .env
|
2024-09-01 21:36:14 +02:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 60s
|
|
|
|
retries: 5
|
2024-08-31 14:50:48 +02:00
|
|
|
expose:
|
|
|
|
- ${REDIS_PORT}
|
|
|
|
|
|
|
|
mailhog:
|
|
|
|
image: mailhog/mailhog:latest
|
|
|
|
restart: ${RESTART_POLICY}
|
|
|
|
container_name: ${PROJECT_NAME}-mailhog
|
|
|
|
env_file: .env
|
|
|
|
expose:
|
|
|
|
- 1025
|