version: '3.8' services: # Django Web Application (Python 3.8.18) web: build: context: . dockerfile: Dockerfile command: gunicorn boday_it.wsgi:application --bind 0.0.0.0:8000 volumes: - .:/code - static_volume:/code/staticfiles - media_volume:/code/mediafiles environment: - DEBUG=0 - SECRET_KEY=aldhguroqugaplslljdgzlshfz - ALLOWED_HOSTS=boday-it.ch,www.boday-it.ch,web,localhost,127.0.0.1 expose: - "8000" restart: always depends_on: - db # PostgreSQL Database Server db: image: postgres:15-alpine volumes: - postgres_data:/var/lib/postgresql/data environment: - POSTGRES_DB=djangodb - POSTGRES_USER=djangouser - POSTGRES_PASSWORD=asafdksdf restart: always # Automatic Let's Encrypt SSL & Reverse Proxy (Caddy) proxy: image: caddy:2-alpine ports: - "80:80" # Natively handles HTTP-01 challenges - "443:443" # Natively serves HTTPS volumes: - ./Caddyfile:/etc/caddy/Caddyfile - static_volume:/code/staticfiles:ro - media_volume:/code/mediafiles:ro - caddy_data:/data - caddy_config:/config restart: always depends_on: - web volumes: postgres_data: static_volume: media_volume: caddy_data: # Important: Keeps your SSL certs safe across container restarts caddy_config: