BotNetwork

Container HEALTHCHECK for bots

Wire Docker HEALTHCHECK to /healthz correctly.

Guide1 min readUpdated

Why it matters

Docker/Kubernetes HEALTHCHECK or probes should hit a cheap /healthz — not a full dependency round-trip that flaps under load.

Practical steps

  1. Split liveness (/healthz) from readiness (/readyz checks deps).
  2. Keep liveness trivial so orchestrators do not kill busy bots.
  3. Use readiness to drain before deploy.
  4. Log probe failures with reason codes.
  5. Align probe timing with graceful shutdown grace period.

Watch out for

  • Liveness that queries Postgres and Discord every 5s.
  • No SIGTERM handler while probes expect instant death.

Related comparisons and tools