Created
October 20, 2023 12:21
-
-
Save dnno/d00d194664efe77cd09abdd66ad638f5 to your computer and use it in GitHub Desktop.
nginx docker-compose.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
nginx: | |
image: nginx:1.25.2 | |
container_name: nginx | |
restart: always | |
volumes: | |
- ./conf/nginx.conf:/etc/nginx/nginx.conf | |
- ./conf/conf.d:/etc/nginx/conf.d | |
- ./data/certbot/conf:/etc/letsencrypt | |
- ./data/certbot/www:/var/www/certbot | |
ports: | |
- 80:80 | |
- 443:443 | |
networks: | |
- proxy | |
- web | |
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" | |
certbot: | |
image: certbot/certbot | |
restart: always | |
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;'" | |
networks: | |
- web | |
networks: | |
proxy: | |
internal: true | |
web: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment