Skip to content

Docker container that runs Nginx and automatically installs letsencrypt certificates

License

Notifications You must be signed in to change notification settings

tkoenig89/nginx-certbot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 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.

Use CERTBOT_OPTIONS=... to pass additional options to certbot

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]

About

Docker container that runs Nginx and automatically installs letsencrypt certificates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 74.2%
  • Dockerfile 25.8%