Docker image to run Letsencrypt certbot command and sharing resources with nginx.
539
Docker image to run Letsencrypt certbot command and sharing resources with nginx.
docker pull caligari/letsencrypt:latest
Available image tags here.
git clone [email protected]:rafacouto/docker-letsencrypt.git
docker build -t caligari/letsencrypt:latest ./docker-letsencrypt
You need to setup the proxy server on your host to redirect /.well-known location requests to serve the directory where letsencrypt generate its verification files required by the CA.
This is my letsencrypt.conf with Nginx:
server {
listen 80;
server_name *;
location /.well-known {
root /var/www/letsencrypt;
try_files $uri =404;
}
}
This is my docker-compose.yml to run the Nginx server:
version: '2'
services:
web:
image: 'nginx:latest'
restart: 'always'
ports:
- '80:80'
- '443:443'
volumes:
- './config:/etc/nginx:ro'
- './letsencrypt/webroot:/var/www/letsencrypt:ro'
- './letsencrypt/conf:/usr/local/letsencrypt:ro'
docker run --rm \
-v $(pwd)/letsencrypt/webroot:/var/www/html \
-v $(pwd)/letsencrypt/conf:/etc/letsencrypt \
-ti caligari/letsencrypt \
/bin/bash
And you can generate new certificates with certbot command:
certbot certonly -d mydomain.com
Content type
Image
Digest
Size
65.4 MB
Last updated
over 8 years ago
docker pull caligari/letsencrypt