version: '3.4' services: nginx: build: context: . dockerfile: Dockerfile ports: - '85:80' - '449:443' restart: always volumes: - ./nginx/conf/:/etc/nginx/conf.d/:ro - /var/www/certbot:/var/www/certbot/:ro - /etc/letsencrypt/:/etc/nginx/ssl/:ro command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"