Cronified LetsEncrypt container.
1.7K
Create and automatically renew website SSL certificates using the letsencrypt free certificate authority, and its client certbot.
This image will renew your certificates every 2 months, and place the lastest ones in the /certs folder in the container, and in the ./certs folder on the host.
In docker-compose.yml, change the environment variables:
docker run --name certbot -v `pwd`/certs:/certs --restart always -e "DOMAINS=domain1.com domain2.com" -e "[email protected]" -e "CONCAT=true" -e "WEBROOT=" henridwyer/docker-letsencrypt-cron
The easiest way to build the image yourself is to use the provided docker-compose file.
docker-compose up -d
The first time you start it up, you may want to run the certificate generation script immediately:
docker exec certbot ash -c "/scripts/run_certbot.sh"
At 3AM, on the 1st of every odd month, a cron job will start the script, renewing your certificates.
To authenticate the certificates, the you need to pass the ACME validation challenge. This requires requests made on port 80 to your.domain.com/.well-known/ to be forwarded to this container.
The recommended way to use this image is to set up your reverse proxy to automatically forward requests for the ACME validation challenges to this container.
If you use a haproxy reverse proxy, you can add the following to your configuration file in order to pass the ACME challenge.
frontend http
bind *:80
acl letsencrypt_check path_beg /.well-known
use_backend certbot if letsencrypt_check
backend certbot
server certbot certbot:80 maxconn 32
If you use nginx as a reverse proxy, you can add the following to your configuration file in order to pass the ACME challenge.
upstream certbot_upstream{
server certbot:80;
}
server {
listen 80;
location '/.well-known/acme-challenge' {
default_type "text/plain";
proxy_pass http://certbot_upstream;
}
}
Find out more about letsencrypt: https://letsencrypt.org
Certbot github: https://github.com/certbot/certbot
Content type
Image
Digest
Size
39.4 MB
Last updated
over 8 years ago
docker pull raspberrypython/docker-letsencrypt-cron