Created
January 12, 2020 19:33
-
-
Save Daniel-ltw/22ea96474084c7f158ccf6bb14089378 to your computer and use it in GitHub Desktop.
Update let's encrypt script
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: | |
command: nginx -c /etc/nginx/nginx.conf -g 'daemon off;' | |
image: <-- insert image here --> | |
logging: | |
driver: json-file | |
options: | |
max-size: 5M | |
ports: | |
- 80:80 | |
- 443:443 | |
ulimits: | |
nofile: | |
soft: 16384 | |
hard: 32768 | |
volumes: | |
- ./dhparam.pem:/etc/nginx/dhparam.pem:ro | |
- ./nginx.ssl.conf:/etc/nginx/sb_plugin/nginx.ssl.conf:ro | |
- ./nginx.s3.conf:/etc/nginx/sb_plugin/nginx.s3.conf:ro | |
- /etc/letsencrypt/live/dna.strategyblocks.com/fullchain.pem:/etc/nginx/sb_plugin/cert.pem:ro | |
- /etc/letsencrypt/live/dna.strategyblocks.com/privkey.pem:/etc/nginx/sb_plugin/key.pem:ro | |
# - /etc/letsencrypt/acme-challenge:/app:ro |
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
#!/usr/bin/env /bin/sh | |
cd releases | |
sed -i -E 's/ # (- \/etc\/letsencrypt\/acme-challenge.*)/ \1/g' docker-compose.yml | |
$(aws ecr get-login --no-include-email --region us-east-1) && docker-compose up -d --force-recreate nginx | |
sudo certbot renew --webroot -w /etc/letsencrypt/acme-challenge | |
sed -i -E 's/ (- \/etc\/letsencrypt\/acme-challenge.*)/ # \1/g' docker-compose.yml | |
$(aws ecr get-login --no-include-email --region us-east-1) && docker-compose up -d --force-recreate nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment