fix(deploy): force-recreate caddy on its roll so config-only changes apply #122
Reference in New Issue
Block a user
Delete Branch "feature/prod-deploy-force-recreate-caddy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Force-recreate caddy on its roll in
prod-deploy.shso a config-only (bind-mountedCaddyfile) change actually loads on a prod deploy.Why
The rolling deploy rolls each service with
compose up -d --no-deps <svc>. For caddy thatis a no-op on a config-only release: its image is pinned (
caddy:2-alpine, no$TAG), sothe compose definition is unchanged between releases — compose treats the container as
current and does not recreate it — and
admin offmeans there is no hot reload. Thenew Caddyfile is seeded to the host but never loaded.
This bit us on v1.2.2: the
Alt-Svc: clearedge fix deployed green, yet prod keptserving
Alt-Svc: h3until caddy was restarted by hand. Verified on the prod host (caddyuptime predated the deploy; the mounted Caddyfile already contained the fix).
Fix
roll()adds--force-recreatefor caddy only (every other service already recreates onits new
$TAGimage). Cost: a ~1–2 s caddy blip per deploy — acceptable for theinfrequent, manual prod rollout. Doc note added to
deploy/README.md.Verification
bash -nclean; tracedroll()— caddy →up -d --no-build --no-deps --force-recreate caddy, other services unchanged. (Prod is already correct after the manual restart; thisprevents the recurrence.)