services: proxy: image: nginx:stable-bullseye command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" ports: - 80:80 - 443:443 volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./certbot/challenge:/data/certbot-challenge:ro - ./certbot/certificates:/data/certificates:ro certbot: image: certbot/certbot:v2.5.0 volumes: - ./certbot/certificates:/etc/letsencrypt - ./certbot/challenge:/data-www-challenge entrypoint: "/bin/sh -c 'sleep 300; trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" # Hello-world http container useful for test/debugging the proxy # an actual service would be used for production example-webservice: image: crccheck/hello-world ports: - 8000