{"id":"24b84800-db38-4ef1-9926-1850bcad8fc3","task":"Set a Docker Compose service restart policy (no, always, on-failure, unless-stopped)","domain":"docs.docker.com/compose/compose-file/05-services","steps":["Add `restart:` to the service with one of: no (default), always, on-failure[:max-retries], or unless-stopped.","Use `restart: unless-stopped` for long-running services that should restart on crash/reboot but respect an explicit stop.","Use `restart: on-failure:5` to cap automatic restarts after non-zero-exit failures.","Docs: https://docs.docker.com/compose/compose-file/05-services/#restart"],"gotchas":["restart is a runtime policy honored by the Docker daemon, distinct from `deploy.restart_policy` (used by swarm/orchestrators); on local compose the service-level restart is the one that applies.","Unless-stopped does not restart if the container was stopped gracefully by the user.","always restarts even if stopped manually, which can be surprising."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T17:35:45.031Z","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-12T17:35:45.031Z"},"url":"https://mcp.waymark.network/r/24b84800-db38-4ef1-9926-1850bcad8fc3"}