Skip to content

Instantly share code, notes, and snippets.

@Daniel-ltw
Created January 12, 2020 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel-ltw/22ea96474084c7f158ccf6bb14089378 to your computer and use it in GitHub Desktop.
Save Daniel-ltw/22ea96474084c7f158ccf6bb14089378 to your computer and use it in GitHub Desktop.
Update let's encrypt script
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
#!/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