-
-
Save elleryq/e29d2de0129640fadbba3ada2c65a0a8 to your computer and use it in GitHub Desktop.
letsencrypt cert generator with docker
This file contains hidden or 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
#!/bin/bash | |
# | |
# 1. create a EC2 instance with public IP | |
# 2. create a A RR in route53 pointing your.domain.com to the public IP | |
# 3. make sure HTTP/HTTPS ports(80 443) are public to all in security group of this EC2 instance | |
# 4. make sure docker daemon is running in this EC2 instance | |
# 5. run this script ! | |
# 6. keys/cert will be generated under /root/letsencrypt/etc/live/ | |
mkdir -p /root/letsencrypt/log /root/letsencrypt/lib /root/letsencrypt/etc | |
email='[email protected]' | |
domain='your.domain.com' | |
docker run --rm -it -p 80:80 -p 443:443 -v "/root/letsencrypt/log:/var/log/letsencrypt" -v "/var/www/:/var/www/" -v "/root/letsencrypt/etc:/etc/letsencrypt" -v "/root/letsencrypt/lib:/var/lib/letsencrypt" lojzik/letsencrypt certonly --email $email -d $domain --standalone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment