auto let's encrypt

This commit is contained in:
Luke Berndt
2023-11-14 21:24:21 -05:00
parent 48414672d3
commit 8fbe4665ed
3 changed files with 124 additions and 16 deletions

View File

@@ -18,12 +18,21 @@ services:
volumes:
- ${PWD}/data/log/syslog:/var/log/syslog
- ${PWD}/data/log/nginx:/var/log/nginx
- ${PWD}/data/certbot/www/:/var/www/certbot/:ro
- ${PWD}/data/certbot/conf/:/etc/letsencrypt/:ro
depends_on:
- backend
- frontend
- account
- admin
command: /bin/bash -c "envsubst '$$DOMAIN_NAME' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
command: /bin/bash -c "envsubst '$$DOMAIN_NAME' < /etc/nginx/conf.d/site.template > /etc/nginx/conf.d/default.conf && while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'"
certbot:
image: certbot/certbot:latest
volumes:
- ${PWD}/data/certbot/www/:/var/www/certbot/:rw
- ${PWD}/data/certbot/conf/:/etc/letsencrypt/:rw
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
mongo:
build: