Skip to content

Instantly share code, notes, and snippets.

@cluelessperson
Created November 27, 2020 18:09
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 cluelessperson/781bb4d4a9e0284a593516dd17f89e9c to your computer and use it in GitHub Desktop.
Save cluelessperson/781bb4d4a9e0284a593516dd17f89e9c to your computer and use it in GitHub Desktop.
---
version: "3.7"
services:
nginx:
image: nginx
volumes:
- nginx-etc:/etc/nginx:ro
- nginx-www:/var/www:ro
- certbot-etc:/etc/letsencrypt:ro
networks:
public:
ipv4_address: redacted
ipv6_address: redacted::2
ports:
- 80
- 443
- 22
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
restart: always
certbot:
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/
- nginx-www:/var/www
# entrypoint: "sleep 6h"
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --no-random-sleep-on-renew; sleep 12h & wait $${!}; done;'"
networks:
- public
restart: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment