bitflicker64 opened a new pull request, #3052:
URL: https://github.com/apache/hugegraph/pull/3052
## Purpose of the PR
- relates to #3043
`docker ps` always shows `Up` even when Java has crashed inside the
container because all three Dockerfiles had no `HEALTHCHECK`. Operators cannot
distinguish a healthy container from a zombie. Also, `cron` was installed in
all three images but is never used in Docker deployments — the cron-based
monitor (`-m true`) is for VM/bare-metal only.
## Main Changes
- Add `HEALTHCHECK` to `hugegraph-server/Dockerfile`,
`hugegraph-pd/Dockerfile`, `hugegraph-store/Dockerfile`:
- Server: `curl http://localhost:8080/versions`
- PD: `curl http://localhost:8620/v1/health`
- Store: `curl http://localhost:8520/v1/health`
- Fallback: if HTTP is not yet up but Java is alive (`kill -0` on pid
file), report healthy — avoids false unhealthy during startup
- Endpoints match what is already used in `docker/docker-compose.yml`
- Remove `cron` from `apt-get install` in all three Dockerfiles — shrinks
image size and reduces attack surface
## Verifying these changes
- [x] Need tests and can be verified as follows:
- `docker run` container → `docker inspect
--format='{{.State.Health.Status}}'` → reports `healthy` once Java is up
- `kill -9` Java inside container → status transitions to `unhealthy`
within `--interval * --retries` seconds
## Does this PR potentially affect the following parts?
- [ ] Dependencies
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects
- [x] Nope
## Documentation Status
- [x] `Doc - No Need`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]