version: '3' services: nginx: image: nginx:1.15-alpine ports: - "80:80" - "443:443" volumes: - ./data/nginx/conf.d:/etc/nginx/conf.d - ./data/nginx/www:/var/www/html - ./data/certbot/conf:/etc/letsencrypt - ./data/certbot/www:/var/www/certbot # command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" certbot: image: certbot/certbot volumes: - ./data/certbot/conf:/etc/letsencrypt - ./data/certbot/www:/var/www/certbot command: "certonly" # # entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"