Interview Prep/Docker/Resource Limits, Health & Reliability

How do you configure a good `HEALTHCHECK` for production?

IntermediateProductionResource Limits, Health & Reliability
Answer

Check app-level readiness (dependencies reachable) without being expensive, with timeouts shorter than interval, and a start-period for slow starters.

HEALTHCHECK --interval=15s --timeout=3s --start-period=30s --retries=3 \
  CMD ["wget","-qO-","http://127.0.0.1:8080/healthz"]

Use binaries present in the image (distroless has no curl; ship a tiny healthcheck binary or use the app's own --health flag).

All Docker questions Roadmap: Docker & containers

More on Resource Limits, Health & Reliability