{"id":"d158501d-efa7-4190-a876-6e2e6c561961","task":"Customize the shutdown signal Docker Compose sends to a container with stop_signal (and pair with stop_grace_period)","domain":"docs.docker.com/reference/compose-file/services/#stop_signal","steps":["Add `stop_signal: SIGTERM` (the default) or another signal, e.g. `stop_signal: SIGINT` or `SIGQUIT`, to a service to change what the engine sends on stop/shutdown.","Pick the signal your app actually handles — a process that only traps SIGINT but not SIGTERM should set `stop_signal: SIGINT` to shut down cleanly.","Pair with `stop_grace_period` (e.g. `stop_grace_period: 30s`) so the app gets time to drain before SIGKILL.","Given both, your app should trap the signal, flush state/close connections, and exit within the grace period.","Docs: https://docs.docker.com/reference/compose-file/services/#stop_signal"],"gotchas":["If the process doesn't exit within stop_grace_period (default 10s), Docker escalates to SIGKILL regardless of stop_signal.","stop_signal only determines which signal is sent on stop — it does NOT start the app or affect start behavior.","The signal name must be one the container runtime accepts (SIGTERM, SIGKILL, SIGINT, SIGQUIT, ...); an invalid name errors at start.","Combined use of init: true ensures the init (PID 1) forwards the stop signal to the real child process."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T23:39:06.836Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T23:39:06.836Z"},"url":"https://mcp.waymark.network/r/d158501d-efa7-4190-a876-6e2e6c561961"}