MrMeeb 53935f50a1
Some checks failed
continuous-integration/drone/tag Build is failing
Merge pull request '1.0.0' (#4) from develop into master
Reviewed-on: #4
2023-06-21 18:20:15 +00:00
2023-06-20 21:27:36 +00:00
2023-06-20 21:27:27 +00:00
2023-06-20 21:27:27 +00:00
2023-06-21 17:32:17 +00:00
2023-06-21 17:32:17 +00:00

Certbot Cron Docker

Drone (self-hosted) with branch Drone (self-hosted) with branch

Dockerised Certbot that utilises cron to schedule creating and renewing SSL certificates. Uses Cloudflare for DNS-01 verification. Automatic renewal attempt happens every 6 hours by default.

Tags

Tag Description
latest Latest image built from the main branch. Usually coincides with a tagged release.
develop Latest image built from the develop branch. Commits are made to the develop branch before being merged to main. Old versions of develop are removed after 14 days.

Running

Docker CLI

docker run -d --name certbot \
    -e EMAIL=admin@domain.com \
    -e DOMAINS=domain.com \
    -e CLOUDFLARE_TOKEN=123abc
    -v /docker/certbot-cron:/config \
    git.mrmeeb.stream/mrmeeb/certbot-cron:latest

Docker Compose

version: "3"
services:
  certbot:
    image: git.mrmeeb.stream/mrmeeb/certbot-cron:latest
    container_name: certbot
    restart: unless-stopped
    volumes:
      - ./certbot:/config
    environment:
      - EMAIL=admin@domain.com
      - DOMAINS=domain.com,*.domain.com
      - CLOUDFLARE_TOKEN=123abc

Environment Variables:

Variable Default Value Description
PUID int 1000
PGID int 1000
TZ List of valid TZs UTC
EMAIL None Email address for renewal information & other communications
DOMAINS None Domains to be included in the certificate. Comma separated list, no spaces. Wildcards supported
INTERVAL 0 */6 * * * How often certbot attempts to renew the certificate. Cron syntax
STAGING false (case-sensitive) Uses the LetsEncrypt staging endpoint for testing - avoids the aggressive rate-limiting of the production endpoint
PROPOGATION_TIME 10 The amount of time (seconds) that certbot waits for the TXT records to propogate to Cloudflare before verifying - the more domains in the certificate, the longer you might need
GENERATE_DHPARAM true (case-sensitive) Generate Diffie-Hellman keys in /config/letsencrypt/keys
CLOUDFLARE_TOKEN N/A Cloudflare token for verification

Volumes

Docker path Purpose
/config Stores configs and LetsEncrypt output for mounting in other containers

Other

Thanks to this guy for explaining how to make cron actually shutdown when stopping the container.

Description
Docker container that runs certbot on a schedule to create and renew SSL certificates
Readme 325 KiB
1.3.0 Latest
2025-01-15 22:02:09 +00:00
Languages
Shell 93.2%
Dockerfile 6.8%