Maintainerr
Maintainerr copied to clipboard
Docker Healthcheck
Creating an healthcheck where Docker can check that the application is healthy and up (maybe utilising supervisorctl or wget) would be beneficial for auto restarts in case something goes wrong.
An idea could be to have the healthcheck be:
["CMD-SHELL", "supervisorctl status || exit 1"]
or similar
And add the following to supervisord.conf
:
[unix_http_server]
file=/dev/shm/supervisor.sock
chmod=0700
[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///dev/shm/supervisor.sock
Happy to raise a PR if the feature is wanted.
Curl has been added as a package in the Docker container in this commit #1288. You should be able to make a health-check now using this guide. This has not been released yet, but you can use the develop tag.
https://thriveread.com/docker-compose-healthcheck-with-curl/#:~:text=Docker%20offers%20internal%20Health%20checks%20for