Add /healthz endpoint and Docker HEALTHCHECK #2
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/issue-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I added
GET /healthzand a DockerHEALTHCHECK, and committed them as98ec248onclaude/issue-1. I could not write the report file. The Write tool was denied permission for/tmp/claude-report-0g5pph1d/report.md, and I did not work around that with another tool. The report text is below.Changes
app/server.py:/healthzreturns200 okas plain text when the MikroTik poller has a successful poll newer than 3 ×poll_interval.503withstale: <router error>orstale: no data from router.Dockerfile:HEALTHCHECKruns every 30s with a 5s timeout, a 30s start period and 3 retries.python3 -cwithurllibagainst127.0.0.1:$DASHY_PORT/healthz, so there are no new packages.urlopenraise, which gives a non-zero exit.CLAUDE.md: documented the endpoint in the Endpoints paragraph. The repo has no README.Verification
/healthzfour times:okpoll_interval2: 503stale: boomHEALTHCHECKcommand was not run inside a container.Open
HEALTHCHECKrelies on--start-period=30sto cover startup.log_messagelogs each 503, so a failing check adds a log line every 30s.CLAUDE.mdmentions ahealthcheck-cmd="python3 /conf/healthcheck.py"on the RouterOS container. RouterOS does not use the image'sHEALTHCHECK, so you can point that at/healthztoo if you want. I left it alone.Closes #1
@claude build the image and verify the HEALTHCHECK passes in a running container
@claude build the image and verify the HEALTHCHECK passes in a running container