dlapiduz / certbot-s3front

Certbot CLI plugin for S3/CloudFront validation and installation
MIT License
584 stars 70 forks source link

Create Dockerfile #58

Closed dirkcuys closed 5 years ago

dirkcuys commented 7 years ago

Add Dockerfile to make it easier to run certbot with the plugin installed

dirkcuys commented 5 years ago

@dlapiduz not sure if you use Docker, but I'm still using this plugin (thank you!) and I find using Docker to install all dependencies in a container helps.

To renew certs, I build the docker image

docker build . -t certbot-s3front

I define a few variables:

echo AWS_ACCESS_KEY_ID=YOUR_ID >> env.list
echo AWS_SECRET_ACCESS_KEY=YOUR_KEY >> env.list

And then whenever I need to renew certs, I run

docker run --rm --name lets-encrypt -it \
    -v ./letsencrypt/:/etc/letsencrypt \
    --env-file env.list \
    certbot-s3front \
        --init \
        --agree-tos \
        -a certbot-s3front:auth \
        -i certbot-s3front:installer \
        --certbot-s3front:auth-s3-bucket <YOUR_AWS_S3_BUCKET> \
        --certbot-s3front:installer-cf-distribution-id <YOUR_AWS_CLOUDFRONT_DISTRIBUTION_ID> \
        -d <YOUR_DOMAIN>
dlapiduz commented 5 years ago

@dirkcuys I merged your commit locally and made some changes to do some updates. Also, I added your message to the Readme.

Please let me know if it is ok. Thanks for the contribution!