Skip to content

feat: add healthcheck.sh for Docker Compose deployments#6

Open
shanzez wants to merge 3 commits into
Platform-Collective:mainfrom
shanzez:feat/compose-healthcheck
Open

feat: add healthcheck.sh for Docker Compose deployments#6
shanzez wants to merge 3 commits into
Platform-Collective:mainfrom
shanzez:feat/compose-healthcheck

Conversation

@shanzez

@shanzez shanzez commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Adds healthcheck.sh - a quick, read-only health probe for a Compose deployment.

What it does

  • Lists every service (from docker compose config --services) and its container status, plus Docker health where a service defines a healthcheck.
  • Optionally checks front reachability if HTTP_PORT is set in .env/huly*.conf.
  • Exits non-zero if any service is not running or is unhealthy, so it drops straight into cron, CI, or a monitoring probe.

Notes

  • No new dependencies; read-only (never touches the stack).
  • Portable shell (bash 3.2+, no mapfile); shellcheck-clean; matches the existing script style.
  • Documented under a new "Health check" section in the README.

Testing

Validated against a Compose stack: exit 0 when all services run; exit 1 (with the stopped service flagged) when one is down.

Contributed by Exaviz (exaviz.com).

Exaviz added 3 commits July 1, 2026 22:04
Reports each service's container status (and Docker health where a
healthcheck is defined) plus front reachability, and exits non-zero if
anything is down, so it works as a cron or monitoring probe. Read-only.

Portable (bash 3.2+, no mapfile). Documented in the README.

Validated: exit 0 when all services run; exit 1 with the down service
flagged when one is stopped.

Signed-off-by: Exaviz <info@exaviz.com>
Signed-off-by: Exaviz <info@exaviz.com>
Found by running against a real deployment: the huly-tools init container
has restart: "no" and exits 0 after doing its work, which the check wrongly
reported as a failure. Now a container that exited 0 with restart policy
'no' is treated as a completed one-shot, not a problem.

Signed-off-by: Exaviz <info@exaviz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant