Docker Health Check Support #345
Labels
feature
New feature. Use severity level labels (level: <level>) to show the severity.
severity: minor
Not blocking features and not disruptive, can be considered "Quality Of Life" change.
I'd like to be able to implement an automated Docker health check on Izzy's container for automated restarts should a fault state ever occur, such as encountering a gateway disconnect and not attempting to reconnect, like has occurred once before.
Docker needs a command that it can run against the container that will return a status code of 0 if the container's service is healthy.
The example they give in the dockerfile reference is
CMD curl -f http://localhost/ || exit 1
Basically, see if application is responding, else exit with status 1, telling Docker the service is dead and the container needs restarted.
The command used for the health check can be anything that can be executed in the container and return the correct exits codes (0 for success and 1 for unhealthy).
ASP.NET has a health check capability that exposes an http endpoint that Docker can curl inside the container to see if the application is alive or not.
Relevant microsoft docs:
https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-7.0
https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/monitor-app-health
From Discord messages:
The text was updated successfully, but these errors were encountered: