fix(docker): tighter healthcheck cadence with start-period
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 53s

Traefik filters containers that are 'unhealthy' or still 'starting'
(no health result yet). The old 30s interval meant kochwas stayed in
'starting' for 30+ seconds after boot, blocking Traefik from routing to it.

New timing:
  --start-period=20s      grace window — failures don't mark unhealthy yet
  --start-interval=2s     fast probes during start-period
  --interval=15s          steady-state cadence after first success
  --timeout=5s, retries=3 unchanged

Container becomes 'healthy' within ~2-5s of the app coming up, so Traefik
picks it up almost immediately after 'docker compose up'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 16:45:00 +02:00
parent 88125935d1
commit ec902049c1

View File

@@ -33,7 +33,7 @@ ENV IMAGE_DIR=/data/images
VOLUME ["/data"]
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
HEALTHCHECK --interval=15s --timeout=5s --retries=3 --start-period=20s --start-interval=2s \
CMD wget -qO- http://localhost:3000/api/health > /dev/null || exit 1
CMD ["node", "build/index.js"]