docker-compose: make VULTR_API_KEY optional

Caddy needs this only for DNS-01 cert renewal via Vultr's API, which
happens within the final 30 days of the cert's 90-day lifetime --
roughly once a quarter. Requiring it to be exported on every `docker
compose up` was friction for routine ops (CoreDNS recreations during
unrelated config changes).

Empty default keeps the stack startable without the key in scope. When
renewal is imminent, set the var properly OR (preferred long-term)
migrate Caddy to caddy-dns/rfc2136 pointing at our own plugin and
retire the Vultr dependency entirely.
This commit is contained in:
Ryan Malloy 2026-05-21 11:17:56 -06:00
parent 6d72d65642
commit 083e29bd3e

View File

@ -11,7 +11,13 @@ services:
environment: environment:
- CADDY_HOSTNAME=${CADDY_HOSTNAME} - CADDY_HOSTNAME=${CADDY_HOSTNAME}
- ACME_EMAIL=${ACME_EMAIL} - ACME_EMAIL=${ACME_EMAIL}
- VULTR_API_KEY=${VULTR_API_KEY:?VULTR_API_KEY must be exported in your shell} # Optional: only required for Caddy's DNS-01 cert renewal via Vultr's
# API. Cert is valid ~90 days; this env var only matters within the
# final 30d renewal window. Empty default keeps `docker compose up`
# working without the key in scope. Set it when renewal is imminent,
# OR migrate Caddy to caddy-dns/rfc2136 (via our plugin) and retire
# the Vultr dependency entirely.
- VULTR_API_KEY=${VULTR_API_KEY:-}
volumes: volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro - ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- ./caddy-data:/data - ./caddy-data:/data