docker-compose.yml and be connected
from the first start:
- DNZ’s environment declares the proxy (
DNZ_PROXY_SEED_KIND=caddy), with a token you pick. The same token goes into Caddy’sdnz.json, so Caddy connects from wherever it calls, without the connect key or an approval. DNZ_ZONESmakes the zone at the first start.- Caddy’s
dnz.jsonis written inline in the compose file (configs.content), so the compose file is the only file. That needs Docker Compose 2.23 or newer.
deploy/caddy-stack/docker-compose.yml.
The file
Replace the values markedCHANGE. Make the proxy token with:
docker-compose.yml
Adding routes
Caddy has no container labels DNZ reads, so routes are made in DNZ. Each one makes the service, the router and the DNS record at once.- Dashboard
- CLI
Open Proxy → edge → Add route, give the hostname and the upstream (
http://whoami:80).whoami.home.example.com resolves to 192.168.1.10.
Certificates
Caddy gets HTTPS certificates itself (Let’s Encrypt or ZeroSSL), which needs the name reachable from the internet on ports 80 and 443. For names that only exist on a LAN, keep the route onhttp://
(--http) or upload a certificate to the proxy (TLS → Certificates). A wildcard needs Caddy
built with a DNS provider module, or an uploaded certificate. See What Caddy gets.
The settings
The sameDNZ_PROXY_SEED_* settings as for Traefik, with
DNZ_PROXY_SEED_KIND=caddy. DNZ_PROXY_SEED_TRAEFIK_API and DNZ_PROXY_SEED_AUTO_RECORDS are for
Traefik only. The fields set there are read-only in the dashboard, the API and the CLI.