Sign inSign up

caligari/letsencrypt

By caligari

Updated over 8 years ago

Docker image to run Letsencrypt certbot command and sharing resources with nginx.

Image
1

539

caligari/letsencrypt repository overview

docker-letsencrypt

Docker image to run Letsencrypt certbot command and sharing resources with nginx.

Get the docker image

Pull a pre-built image
docker pull caligari/letsencrypt:latest

Available image tags here.

From Dockerfile
git clone [email protected]:rafacouto/docker-letsencrypt.git
docker build -t caligari/letsencrypt:latest ./docker-letsencrypt

Prepare the connection with your web proxy

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'

Usage

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

Tag summary

Content type

Image

Digest

Size

65.4 MB

Last updated

over 8 years ago

docker pull caligari/letsencrypt