version: "3" services: nginx: image: nginx:latest container_name: nginx ports: - "80:80/tcp" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/conf.d:/etc/nginx/conf.d - ./static:/static - ./user_data:/user_data - ./certbot/conf:/etc/letsencrypt - ./certbot/www:/var/www/certbot depends_on: - web certbot: image: certbot/certbot container_name: certbot_service volumes: - ./certbot/conf:/etc/letsencrypt - ./certbot/logs:/var/log/letsencrypt - ./certbot/www:/var/www/certbot entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" web: build: context: . dockerfile: Dockerfile container_name: web restart: always command: gunicorn DCCWWebDemo.wsgi:application --bind 0.0.0.0:8000 volumes: - ./static:/app/static - ./user_data:/app/user_data expose: - "8000" - "443"