Interview Prep/Docker/Limits, logging, health checks and restarts

Tune a health check for a slow-starting app (2 minutes boot).

IntermediateScenarioLimits, logging, health checks and restarts
Answer

Situation read → Early failures would mark it unhealthy.

What I'd do →

HEALTHCHECK --start-period=150s --interval=10s --timeout=3s --retries=3 \
  CMD wget -qO- http://localhost:8080/healthz || exit 1

Why → Failures during start-period don't count toward retries, and the first success ends it.

Interview tip → Make sure wget/curl exists in the image.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts