version: '3.8' services: postgresql: image: postgres container_name: ${PROJECT_NAME}-postgresql restart: always environment: POSTGRES_USER: ${DB_USER} POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: ${DB_NAME} ports: - ${DB_PORT}:5432 django: build: context: ./ dockerfile: ./Dockerfiles/django/Dockerfile container_name: ${PROJECT_NAME}-django restart: always entrypoint: /django-launcher.sh volumes: - .:/usr/src/app/ environment: DEBUG: "False" ALLOWED_HOSTS: ${DOMAIN} SECRET_KEY: ${DJANGO_SECRET_KEY} DB_NAME: ${DB_NAME} DB_USER: ${DB_USER} DB_PASSWORD: ${DB_PASSWORD} DB_HOST: ${DB_HOST} DB_PORT: ${DB_PORT} DOMAIN: ${DOMAIN} DOMAIN_URL: ${DOMAIN_URL} STATIC_URL: /static/ STATIC_ROOT: static MEDIA_URL: /media/ REDIS_HOST: ${REDIS_HOST} REDIS_PORT: ${REDIS_PORT} EMAIL_HOST: ${EMAIL_HOST} EMAIL_USE_TLS: ${EMAIL_USE_TLS} EMAIL_USE_SSL: ${EMAIL_USE_SSL} EMAIL_PORT: ${EMAIL_PORT} EMAIL_USER: ${EMAIL_USER} EMAIL_PASSWORD: ${EMAIL_PASSWORD} expose: - 8000 depends_on: - postgresql links: - redis caddy: image: caddy:alpine container_name: ${PROJECT_NAME}-caddy restart: always ports: - ${CADDY_PORT_ONE}:80 - ${CADDY_PORT_TWO}:443 volumes: - ./Caddyfile.pro:/etc/caddy/Caddyfile - ./caddy_data:/data - .:/usr/src/app/ depends_on: - django redis: image: redis:alpine container_name: ${PROJECT_NAME}-redis restart: always expose: - ${REDIS_PORT}