services: postgresql: image: postgres:16 container_name: ${PROJECT_NAME}-postgresql restart: ${RESTART_POLICY} env_file: .env environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_NAME} volumes: - ./data_postgresql:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] interval: 30s timeout: 60s retries: 5 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: - ./static:/usr/share/nginx/html/static - ./media:/usr/share/nginx/html/media - ./nginx.conf:/etc/nginx/nginx.conf depends_on: - django redis: image: redis:alpine restart: ${RESTART_POLICY} container_name: ${PROJECT_NAME}-redis env_file: .env healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 60s retries: 5 expose: - ${REDIS_PORT} mailhog: image: mailhog/mailhog:latest restart: ${RESTART_POLICY} container_name: ${PROJECT_NAME}-mailhog env_file: .env expose: - 1025