Kill unhealthy
Since docker-compose has restart:unless-stopped option I added self-killing healthcheck
I don't think this change is a good idea: it introduces unexpected side-effects into the healthcheck.
It really does, but what is the point of having unhealthy label without automatic recovery?
As another way of doing it I see adding this guy to a docker-compose. https://hub.docker.com/r/willfarrell/autoheal/
Sure. If someone who's using this image explicitly wants a management layer that kills unhealthy containers, that's their business. It'd be inappropriate to force that on them by baking such logic into this image, though.
Yeah https://hub.docker.com/r/willfarrell/autoheal/ is the way to go. Healthchecks only ever report a status.
Finally found some time to update my PR. I believe this solution worth to be merged
Looks good to me.
Not sure if AUTOHEAL_CONTAINER_LABEL: all is the best way, or instead the container should get a label instead, so we don't suddenly restart other services on that docker server as well.
Maybe @dperson needs to decide that.
@dperson any objections?
To elaborate more: I'd prefer having the restart label on that exact container, so it doesn't accidentally kill other containers which might be there before this.
However that would introduce a change to the configuration to the actual image, which might confuse new users. They might think that would be needed for running VPN.
How will killing the container that's hosting the network stack for other containers affect those other containers?
After you will restart a network container, all dependent containers will loose network at all. In my setup I restart them as well to update network link to net container. So far it works flawlessly
In that case, could it make sense to include that in the docker file as well?
Now only containers with label autoheal=true will be killed
I like that.
Actually started using autoheal in my own system now as well.
@dperson or someone who is trusted with the merges would need to have a look at it now.
@dperson is there anything I can do to merge this PR?
any update with that? its a great idea