Skip to content

Instantly share code, notes, and snippets.

@GlenMerlin
Created September 29, 2022 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GlenMerlin/6a0e3fde632a1a4441bdeda1d9d8162f to your computer and use it in GitHub Desktop.
Save GlenMerlin/6a0e3fde632a1a4441bdeda1d9d8162f to your computer and use it in GitHub Desktop.
version: '2'
services:
nginx-terminate:
tty: true
build: ./nginx-terminate/
restart: unless-stopped
volumes:
- ./data/nginx-terminate:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
ports:
- "443:443"
- "80:80"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; /opt/nginx/sbin/nginx -s reload; done & /opt/nginx/sbin/nginx -c /etc/nginx/conf.d/nginx.conf -g \"daemon off;\"'"
nginx-relay:
build: ./nginx-relay/
restart: unless-stopped
volumes:
- ./data/nginx-relay:/etc/nginx/conf.d
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; /opt/nginx/sbin/nginx -s reload; done & /opt/nginx/sbin/nginx -c /etc/nginx/conf.d/nginx.conf -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment