# /etc/caddy/Caddyfile — RENDERED BY TERRAFORM for ${domain}. # Caddy provisions a Let's Encrypt cert on first request and auto-renews; the domain's # A/AAAA record must already point at this host and ports 80/443 must be open. # # The app owns the domain root and runs with THERMOGRAPH_BASE=/, so everything is # reverse-proxied to the single uvicorn on 127.0.0.1:${port}. # # NOTE: the repo's deploy/Caddyfile additionally serves the emigriffith.dev portfolio # and legacy redirects; those are host-specific and intentionally not templated here. ${domain} { encode zstd gzip # Active health check on the same cheap /healthz route the container's own # HEALTHCHECK uses (Dockerfile) — so a `docker compose up -d --build` deploy # that's still restarting/booting never gets proxied into (a reload alone has # no gate, hop-1 runbook hazard #10). health_uri is relative to the upstream. reverse_proxy 127.0.0.1:${port} { health_uri /healthz health_interval 5s health_timeout 3s health_status 2xx } log { output file /var/log/caddy/thermograph.log } }