https://github.com/brahma-dev/acme-lego-cron
Dockerized Lego with cron.
https://github.com/brahma-dev/acme-lego-cron
acme acme-dns certificate cron docker lego
Last synced: 4 months ago
JSON representation
Dockerized Lego with cron.
- Host: GitHub
- URL: https://github.com/brahma-dev/acme-lego-cron
- Owner: brahma-dev
- License: mit
- Created: 2020-07-29T11:16:07.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2026-02-19T14:16:27.000Z (5 months ago)
- Last Synced: 2026-02-19T17:53:29.156Z (5 months ago)
- Topics: acme, acme-dns, certificate, cron, docker, lego
- Language: Shell
- Homepage: https://hub.docker.com/r/brahmadev/acme-lego-cron
- Size: 58.6 KB
- Stars: 8
- Watchers: 0
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# acme-lego-cron
[](https://github.com/brahma-dev/acme-lego-cron/actions)
Dockerized [Lego](https://go-acme.github.io/lego/) with cron. Caters to DNS ACME challenge; other challenges can be worked out using `LEGO_ARGS`.
## Environment variables
Environment variables are used to control various steps of the automation process.
## Lego
| Name | Default value | Description | Corresponds to `lego` argument |
|:-------:|:---------------:|:---------:|:---------:|
| `STAGING` | `0` | Whether to use production or staging LetsEncrypt endpoint. 0 for production, 1 for staging
| `KEY_TYPE` | `ec384` | Type of key. | `--key-type`
| `DOMAINS` | `""` | Domains (delimited by ';' ) | `--domains`, `-d`
| `EMAIL_ADDRESS` | `""` | Email used for registration and recovery contact. | `--email`, `-m`
| `PROVIDER` | `""` | DNS Provider. Valid values are:
`com35`,`active24`,`edgedns`,`alidns`,`aliesa`,`allinkl`,
`alwaysdata`,`lightsail`,`route53`,`anexia`,`artfiles`,
`arvancloud`,`auroradns`,`autodns`,`axelname`,`azion`,
`azure`,`azuredns`,`baiducloud`,`beget`,`binarylane`,
`bindman`,`bluecat`,`bluecatv2`,`bookmyname`,`brandit`,
`bunny`,`checkdomain`,`civo`,`cloudru`,`clouddns`,
`cloudflare`,`cloudns`,`cloudxns`,`conoha`,`conohav3`,
`constellix`,`corenetworks`,`cpanel`,`ddnss`,`derak`,
`desec`,`designate`,`digitalocean`,`directadmin`,
`dnsmadeeasy`,`dnsexit`,`dnshomede`,`dnsimple`,`dnspod`,
`dode`,`domeneshop`,`dreamhost`,`duckdns`,`dyn`,
`dyndnsfree`,`dynu`,`easydns`,`edgecenter`,`efficientip`,
`epik`,`exoscale`,`exec`,`f5xc`,`freemyip`,`namesurfer`,
`gcore`,`gandi`,`gandiv5`,`gigahostno`,`glesys`,`godaddy`,
`gcloud`,`googledomains`,`gravity`,`hetzner`,`hostingde`,
`hostingnl`,`hostinger`,`hosttech`,`httpreq`,`httpnet`,
`huaweicloud`,`hurricane`,`hyperone`,`ibmcloud`,`iijdpf`,
`infoblox`,`infomaniak`,`iij`,`internetbs`,`inwx`,`ionos`,
`ionoscloud`,`ipv64`,`ispconfig`,`ispconfigddns`,
`iwantmyname`,`jdcloud`,`joker`,`acme-dns`,`keyhelp`,
`leaseweb`,`liara`,`limacity`,`linode`,`liquidweb`,
`loopia`,`luadns`,`mailinabox`,`manageengine`,`manual`,
`metaname`,`metaregistrar`,`mijnhost`,`mittwald`,`myaddr`,
`mydnsjp`,`mythicbeasts`,`namedotcom`,`namecheap`,
`namesilo`,`nearlyfreespeech`,`neodigit`,`netcup`,
`netlify`,`nicmanager`,`nifcloud`,`njalla`,`nodion`,`ns1`,
`octenium`,`otc`,`oraclecloud`,`ovh`,`plesk`,`porkbun`,
`pdns`,`rackspace`,`rainyun`,`rcodezero`,`regru`,`regfish`,
`rfc2136`,`rimuhosting`,`nicru`,`sakuracloud`,`scaleway`,
`selectel`,`selectelv2`,`selfhostde`,`servercow`,
`shellrent`,`simply`,`sonic`,`spaceship`,`stackpath`,
`syse`,`technitium`,`tencentcloud`,`edgeone`,
`timewebcloud`,`todaynic`,`transip`,`safedns`,`ultradns`,
`uniteddomains`,`variomedia`,`vegadns`,`vercel`,`versio`,
`vinyldns`,`virtualname`,`vkcloud`,`volcengine`,`vscale`,
`vultr`,`webnamesca`,`webnames`,`websupport`,`wedos`,
`westcn`,`yandex360`,`yandexcloud`,`yandex`,`zoneee`,
`zoneedit`,`zonomi` | `--dns`
| `DNS_TIMEOUT` | `10` | Set the DNS timeout value to a specific value in seconds. | `--dns-timeout`.
| `LEGO_ARGS` | `""` | Send arguments directly to lego, e.g. `"--dns.disable-cp"` or `"--dns.resolvers 1.1.1.1"` |
--------------------
## Hooks
You can mount a shell script to /app/hook.sh to run whenever a cert is issued. This image comes with bash/curl/wget/jq preinstalled.
## Examples
This example get one certificate for `*.example.com` and `example.com` using cloudflare dns :
- Use staging endpoint during development.
```yaml
services:
lego:
image: brahmadev/acme-lego-cron:latest
environment:
STAGING: 1
DOMAINS: "example.com;*.example.com"
EMAIL_ADDRESS: user@example.com
CLOUDFLARE_DNS_API_TOKEN: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PROVIDER: cloudflare
LEGO_ARGS: "--dns.disable-cp --dns.resolvers 1.1.1.1"
volumes:
- ./letsencrypt:/letsencrypt
```
With hook: Check [hook.sh](https://github.com/brahma-dev/acme-lego-cron/blob/main/app/hook.sh "hook.sh") for an example.
```yaml
services:
nginx:
container_name: nginx01
image: nginx:alpine
ports:
- mode: host
published: 443
target: 443
- mode: host
published: 80
target: 80
volumes:
- ./html/:/var/www/html
- ./nginx-example.conf:/etc/nginx/conf.d/default.conf
- "./letsencrypt:/letsencrypt"
lego:
image: brahmadev/acme-lego-cron:latest
environment:
STAGING: 1
DOMAINS: "example.com;*.example.com"
EMAIL_ADDRESS: user@example.com
CLOUDFLARE_DNS_API_TOKEN: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
PROVIDER: cloudflare
LEGO_ARGS: "--dns.disable-cp --dns.resolvers 1.1.1.1"
volumes:
- ./hook.sh:/app/hook.sh
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt:/letsencrypt
```