NebulousLabs / docker-sia

The official docker image for the Sia daemon
https://sia.tech
MIT License
20 stars 1 forks source link

Add a HEALTHCHECK and an "autoheal" LABEL. #8

Closed ro-tex closed 4 years ago

ro-tex commented 4 years ago

This PR introduces a HEALTHCHECK command and an autoheal label.

The healthcheck script is executed every 10 seconds and verifies that the socat relay is still up. If it's not it marks the container as "unhealthy".

Marking a container as "unhealthy" doesn't do anything on its own, aside from triggering a health_status event. It does, however, allows the user to handle the situation within their system (e.g. Kubernetes can monitor the health of the containers it's running). A simple way to achieve that is by using the willfarrell/autoheal container that can monitor and restart any unhealthy container that's labelled with autoheal.

Fixes #3