Skip to content

Instantly share code, notes, and snippets.

@spalladino
Created January 20, 2016 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save spalladino/b0aa03d3119780398136 to your computer and use it in GitHub Desktop.
Save spalladino/b0aa03d3119780398136 to your computer and use it in GitHub Desktop.
Template for renewing a letsencrypt certificate in a docker nginx proxy via letsencrypt's docker image
#!/bin/sh
mkdir -p {{ proxy_dir }}/www/{{ domain }}
docker pull quay.io/letsencrypt/letsencrypt
docker run -it --rm --name letsencrypt \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
--volumes-from {{ proxy_docker_container }} \
quay.io/letsencrypt/letsencrypt \
certonly \
--webroot \
--webroot-path /var/www/{{ domain }} \
--agree-tos \
--renew-by-default \
-d {{ domain }} \
-m {{ email }}
docker kill --signal=HUP {{ proxy_docker_container }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment