qdm12 / deunhealth

Binary program to restart unhealthy Docker containers
MIT License
117 stars 8 forks source link

Feature request: Allow setting a custom timeout for container stopping #87

Open enchained opened 2 months ago

enchained commented 2 months ago

Some containers, for example qbittorrent or databases, may need extra time to shutdown depending on usage. By default it's only 10 seconds before the kill, but in my case it may take up to 40 seconds to exit properly.

Premature kill of qbittorrent usually results in a very long resuming startup and extra HDD usage. There were hours of slow resuming in the logs until I tried stopping with docker compose down -t 120 instead, and now it is up and running in under 2 minutes.

willfarrell/autoheal implements this feature via AUTOHEAL_DEFAULT_STOP_TIMEOUT env var and individual container labels.