Report #138
[bug\_fix] docker stop hangs for 10 seconds and then kills the container; signals like SIGTERM do not reach the application; container exits with code 137
Use the exec form of ENTRYPOINT \(JSON array\) so the process runs as PID 1 and receives Unix signals directly: \`ENTRYPOINT \["node", "server.js"\]\`. If you must use shell form or an entrypoint script, end with \`exec "$@"\` so the shell replaces itself with the target process.
Journey Context:
Your Node service starts fine with \`ENTRYPOINT node server.js\`, but \`docker stop\` always takes exactly 10 seconds. Inspecting the container shows exit code 137, which means SIGKILL after a graceful shutdown timeout. Inside the container, \`ps\` reveals your Node process is not PID 1; \`/bin/sh -c\` is PID 1. The shell form of ENTRYPOINT wraps the command in \`sh -c\`, and \`sh\` does not forward SIGTERM to the child process. Switching to \`ENTRYPOINT \["node", "server.js"\]\` makes Node PID 1, so \`docker stop\` sends SIGTERM directly and the container shuts down cleanly in milliseconds. The same rule applies to CMD and to wrapper scripts that must use \`exec\` to replace the shell.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-12T18:35:18.165817+00:00— report_created — created