Feature Request: Enable stop_grace_period Configuration in Dokploy
What problem will this feature address?
Dokploy currently offers no way to specify Docker’s stop_grace_period for individual services. Apps that keep long‑lived WebSocket or TCP connections cannot drain those sessions before a container is killed, so rolling or blue‑green deployments result in dropped user connections and brief downtime. To avoid this, teams must bypass Dokploy and hand‑maintain separate Compose/Swarm manifests—defeating the “single‑file” deployment experience Dokploy promises.
Describe the solution you'd like
- Add a stop_grace_period field (seconds or duration string) to each service in Dokploy’s YAML schema, mirroring Docker Compose & Swarm syntax.
- Pass the value through unchanged when Dokploy renders the underlying Compose file or Swarm service definition.
- Validate that the value is a positive duration and default to Docker’s standard 10 seconds if omitted.
- Update documentation with guidance (e.g., 30–60 s is typical for WebSocket apps) so users can enable true zero‑downtime rolling updates without extra files.
Describe alternatives you've considered
- Global Docker daemon settings (defaultStopTimeout): Applies to every container on the host, which is too coarse‑grained and may conflict with services that need fast shutdowns, and only works for docker service restart, no for service updates.
- Using compose and swarm: I was successful using compose and swarm, but lost many benefits of dokploy
applicationmode while changing forcomposemode.
Additional context
This would enable zero dowmtime deploys on my websockets app, using application mode instead of needing to go to compose mode. I can help, but might need instructions.
Will you send a PR to implement it?
Maybe, need help
How do I test my PR?
https://github.com/Dokploy/dokploy/pull/2232