Created
April 28, 2018 08:27
-
-
Save felixcarmona/839c31f0d7fa518418dceabd6a941221 to your computer and use it in GitHub Desktop.
dockerized nginx-proxy (with letsencrypt ssl)
This file contains 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
nginx-proxy-start: | |
docker run -d --restart=always --net=host -p 80:80 -p 443:443 -v $(dir $(abspath $(lastword $(MAKEFILE_LIST))))certs:/etc/nginx/certs:ro -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy | |
nginx-proxy-stop: | |
docker rm $$(docker stop $$(docker ps -a -q --filter ancestor=jwilder/nginx-proxy --format="{{.ID}}")) | |
nginx-proxy-restart: | |
-make nginx-proxy-stop | |
make nginx-proxy-start | |
renew-certs: | |
certbot renew --force-renewal | |
mkdir -p certs | |
for domain in /etc/letsencrypt/live/*; do cp $$domain/fullchain.pem certs/$$(basename $$domain).crt && cp $$domain/privkey.pem certs/$$(basename $$domain).key; done | |
make nginx-proxy-restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment