-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add curl on the Docker image #18462
Conversation
Handle container status with basic healthcheck
The frontend is optional, so this will fail for people that chose not to enable the frontend. |
My bad ! Could keeping curl embed be an acceptable solution for you ? It will allow people using docker and docker compose to get the status easily ? healthcheck:
test: [ "CMD", "curl", "http://127.0.0.1:8080/#/" ]
interval: 1m
timeout: 10s
retries: 3
start_period: 60s |
Commit and description updated 🚀 |
@sjorge while the frontend is indeed optional, I don't see a better way to do a healthcheck |
Is there an easy way to see if it’s enabled? And then pick the curl check or /bin/true otherwise? |
@sjorge this config is not done from the z2m side but in the docker-compose.yml (so user has to make sure frontend is enabled when deciding to add this healthcheck) |
Maybe a solution could be using a MQTT message. Ask zigbee2mqtt for its status using a MQTT message an read its response using another topic. |
Why don't you just use healthcheck:
test: [ "CMD", "wget", "-O-", "http://127.0.0.1:8080/#/" ]
interval: 1m
timeout: 10s
retries: 3
start_period: 60s Or just check if the process is running with healthcheck:
test: [ "CMD", "pgrep", "node" ]
interval: 1m
timeout: 10s
retries: 3
start_period: 60s Both solutions are untested, but should theoretically work. |
@alex3305 wget seems to be available indeed so curl is not needed.
|
Thanks for your amazing work!
Add curl to be able to manage health check with Docker.
$ docker ps koenkk/zigbee2mqtt:1.32.1 "docker-entrypoint.s…" 3 hours ago Up 3 hours (healthy) zigbee2mqtt
This MR need to be squashed 🙏