Open mikaelparkefelt opened 2 months ago
It currently isn't possible since the whoami Docker image is based on "scratch", which is basically a completely empty operating system. So no curl
included.
It think it would be pretty easy to add a flag which, when enabled, just does a health check. So you'd just run the /whoami -healthcheck
command and it does the request.
I also described this in #81.
So in the compose file I add command: /whoami --healthcheck
insted of the default one?
@mikaelparkefelt wrote: So in the compose file I add
command: /whoami --healthcheck
insted of the default one?
You WOULD but it's currently not implemented!
So what exactly should i do then to get healthcheck to work?
@mikaelparkefelt wrote: So what exactly should i do then to get healthcheck to work?
At the moment there is not much you can do, except modify the container yourself, and f.e. inject the curl binary into it with a bind mount. Maybe I'll work on a PR which implements a healthcheck feature, though.
Here's how you could do it: docker run --rm --name whoami -v /usr/bin/curl:/curl --health-cmd '/curl --fail http://localhost:80/health' traefik/whoami
I would like you add the possibility to add a HEALTH CHECK when running this container with a compose file.
Would this be possible to do that? or tell me what the syntax is int he compose file to get a health check.