Public | Automated Build

Last pushed: a month ago
Short Description
Nginx with automatical letsencrypt certificate renewal
Full Description

docker-nginx-letsencrypt

A simple naive docker image, to run nginx with letsencrypt certificate renewal periodically (once in 5d).

Features

  • Support muitiple domains in one certificate currently (through letsencrypt auto certification).
  • Includes git-auto-pull, which support simple deployments with GitHub {push, release, pull_request} events Webhooks, and GitLab push Webhooks.

Usage

docker run -d --name my-nginx-with-le \
    -p 80:80 -p 443:443 \
    -v /srv/webroot:/srv/web \
    -v /srv/letsencrypt:/etc/letsencrypt \
    -e EMAIL="myemail@somesite.com" \
    -e DOMAIN_NAME="example.com sss.example2.com" \
    senorsen/nginx-letsencrypt:latest

This image also contains a simple git-auto-pull.

Environment Variables

  • EMAIL your email pass to certbot
  • DOMAIN_NAME domain(s), multiple domains should seperated by space, and the first domain is used as common name (CN)
  • DISABLE_DEFAULT_CONF if set, 000-default.conf nginx conf will not be generated
  • DISABLE_UPDATE_NGINX_RESOLVER if set, we won't update nginx resolver configuration accoring to docker (the one set by docker in /etc/resolv.conf)
  • PRE_UP_SCRIPT script run before nginx up

Help

Q: Looking for proxy_pass or more complicated nginx configuration?

A: Set env DISABLE_DEFAULT_CONF, then write your own config.

ENV DISABLE_DEFAULT_CONF 1
COPY your-nginx-config.conf /etc/nginx/conf.d/
Docker Pull Command
Owner
senorsen

Comments (0)