Maintainerr icon indicating copy to clipboard operation
Maintainerr copied to clipboard

Docker Healthcheck

Open modem7 opened this issue 11 months ago • 2 comments

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.

modem7 avatar Mar 26 '24 22:03 modem7

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.

modem7 avatar Mar 26 '24 22:03 modem7

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

ydkmlt84 avatar Oct 04 '24 18:10 ydkmlt84