I was not aware docker-compose doesn't do this by default.
The specific case that prompted this was that OpenProject ran into an infinite loop making the process completely unresponsive but the container was still considered healthy by docker.
I've added a healthcheck to make sure the unhealthy condition is actually recognized.
But even then the container is only shown as unhealthy and not restarted.
I was not aware docker-compose doesn't do this by default.
The specific case that prompted this was that OpenProject ran into an infinite loop making the process completely unresponsive but the container was still considered healthy by docker.
I've added a healthcheck to make sure the unhealthy condition is actually recognized. But even then the container is only shown as unhealthy and not restarted.
Hence I've added the autoheal service.