2022-10-29 11:29:59 -05:00
|
|
|
# 2022-10-05 Hyperling
|
2023-07-05 20:54:53 -07:00
|
|
|
# Reverse Proxy with LetsEncrypt Certbot.
|
|
|
|
# This is a revised version of these works:
|
2022-10-29 11:29:59 -05:00
|
|
|
# https://phoenixnap.com/kb/docker-nginx-reverse-proxy
|
|
|
|
# https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/
|
2023-07-05 20:54:53 -07:00
|
|
|
# https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
|
2022-10-29 11:29:59 -05:00
|
|
|
|
2023-07-05 20:02:50 -07:00
|
|
|
version: '3'
|
2022-10-29 11:29:59 -05:00
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
2023-07-05 20:02:50 -07:00
|
|
|
build: .
|
2022-10-29 11:29:59 -05:00
|
|
|
restart: always
|
|
|
|
ports:
|
2023-07-05 20:54:53 -07:00
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
volumes:
|
|
|
|
- ../../Volumes/ReverseProxy/letsencrypt-certs:/etc/nginx/certs-letsencrypt
|
|
|
|
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
|
|
|
|
certbot:
|
|
|
|
image: certbot/certbot
|
|
|
|
volumes:
|
|
|
|
- ../../Volumes/ReverseProxy/letsencrypt-etc:/etc/letsencrypt
|
|
|
|
- ../../Volumes/ReverseProxy/letsencrypt-certs:/var/www/certbot
|
|
|
|
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|