qdm12 / deunhealth

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

Feature request: Add option to force container re-create rather than restart #16

Closed oester closed 3 years ago

oester commented 3 years ago

If you have a service configured similar to the following:

network_mode: "container:gluetun"
    healthcheck:
      test: "curl -sf https://google.com  || exit 1"
      interval: 1m
      timeout: 10s
      retries: 1
    labels:
      - deunhealth.restart.on.unhealthy=true

And the gluetun container is re-created due to a new version, the using container is marked as "unhealthy" but a container restart won't work because the container ID of the gluetun container is changed.

Consider adding an option "deunhealth.recreate.on.unhealthy=true" to resolve this.

qdm12 commented 3 years ago

It's a bit more complicated than that, but yes this is in progress :wink: This duplicates #11.

You might want to subscribe/read the bottom comments on #11 feel free to give your input too!