Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Docker container that runs Nginx and automatically installs letsencrypt certificates

License

Notifications You must be signed in to change notification settings

kitspace/docker-nginx-certbot-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Container with Nginx, Certbot and the Certbot Nginx Plugin

Docker container that runs Nginx and requests and installs letsencrypt https certificates through Certbot.

This is mainly just the upstream Nginx Alpine container but runs the simple script in ./command that requests and installs a certificate through the Certbot Nginx plugin (a.k.a certbot --nginx) if you set variables:

RUN_CERTBOT=true
CERTBOT_DOMAINS=example.com,www.example.com
[email protected]

This is inspired by/partially copied from staticfloat/docker-nginx-certbot but scripting is vastly simplified by just relying on cerbot --nginx.

Usage

In a development/testing environment you can simply leave RUN_CERTBOT unset or RUN_CERTBOT=false and you can test your Nginx config without https locally.

The script in the container will attempt certificate renewal every 7 days.

Docker

docker run -e 'RUN_CERTBOT=true' -e 'CERTBOT_DOMAINS=example.com,www.example.com' -e '[email protected]' kitspace/nginx-certbot-plugin

Docker Compose

services:
  nginx:
    image: kitspace/nginx-certbot-plugin 
    environment:
      - RUN_CERTBOT=true
      - CERTBOT_DOMAINS=example.com,www.example.com
      - [email protected]