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

Graceful shutdown with a 60-second drain for in-flight requests.

IntermediateScenarioLimits, logging, health checks and restarts
Answer

Situation read → Default stop timeout is 10 s.

What I'd do → Handle SIGTERM in the app (stop accepting, finish requests), then docker stop -t 60 or Compose stop_grace_period: 60s. Set STOPSIGNAL SIGQUIT for nginx-style graceful stop.

Why → Docker sends the stop signal, waits, then SIGKILL.

Interview tip → Verify the process is PID 1 or forwards signals.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts