Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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