The OGs would remember the script that @asynchroza wrote back in the days.
You migtht ask don't we have a restart policy defined for each service in the docker compose? Yes we do have one, but this is not going to restart the container if it's marked unhealthy by the healthckek.
The challenging part are the alarms. On top of my head I can think of something like this:
Use docker inspect to count how many times the container has restarted. If it's more than 3 send an email to @Isak-Bego
Probably there is a better way, but more research is needed here.
Brief description:
The OGs would remember the script that @asynchroza wrote back in the days.
You migtht ask don't we have a restart policy defined for each service in the docker compose? Yes we do have one, but this is not going to restart the container if it's marked unhealthy by the healthckek.
How to achieve it
There is a really cool tool: https://github.com/willfarrell/docker-autoheal
The challenging part are the alarms. On top of my head I can think of something like this: Use docker inspect to count how many times the container has restarted. If it's more than 3 send an email to @Isak-Bego
Probably there is a better way, but more research is needed here.