Let the Mercure image say whether the Mercure image is healthy

Follow-up to eca0f8b7, which pointed our healthcheck at the hub's new
readiness path. Correct, and still the wrong shape: it leaves plMail asserting
something about the internals of an image that is deliberately unpinned so it
can update itself. The next time the hub moves that path, CI goes red for
another three days.

The image has always shipped its own HEALTHCHECK — wget against
127.0.0.1:2019/mercure/health/ready, 60s grace, 5s timeout, 5 retries — which
is the same grace and retries compose.yaml was spelling out by hand. Inheriting
it costs nothing there and cannot drift, because it travels with the image it
describes.

The test stack wanted to keep its five-second interval and inherit the command,
and Compose refuses: a healthcheck block without a `test` is rejected with
"must define a healthcheck command for all healthchecks". So owning the cadence
means owning the command again, which is the thing that rotted. It asks every
30s now — a few more seconds before a job starts, against never again waiting
for ever.

Verified against the current image: the running container carries the image's
healthcheck verbatim and reports healthy, and the test stack comes up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Paul LütznerandClaude Opus 5 committed 2026-09-21 11:42:29 +02:00
1 parent eca0f8b74d
commit 5c667fb4f8
3 files changed
+27 -25

No files matched your search

+11 -11
View File
@@ -299,17 +299,17 @@ services:
depends_on:
secrets-init:
condition: service_completed_successfully
healthcheck:
# The ADMIN endpoint, not "/healthz" on the hub port, and not a URL of
# our own choosing. The hub moved its readiness probe: "/healthz" now
# answers 404, `curl -f` treats that as failure, and the container is
# marked unhealthy for ever while serving perfectly. The image's own
# HEALTHCHECK has always used this path — overriding it with a guess is
# what let the two drift apart, and the guess is the half that rotted.
test: ["CMD", "curl", "-f", "http://127.0.0.1:2019/mercure/health/ready"]
timeout: 5s
retries: 5
start_period: 60s
# NO `test:` HERE ON PURPOSE — the image's own HEALTHCHECK is used.
#
# We used to spell one out, aimed at "/healthz", and the hub moved its
# readiness probe out from under it: "/healthz" answers 404 now, `curl
# -f` reads a 404 as failure, and this container reported itself unhealthy
# for ever while serving every subscription put to it. The image is
# deliberately on a floating tag so it keeps up to date by itself, which
# means anything we hard-code about its internals is a thing waiting to
# rot. Its own check — wget against 127.0.0.1:2019/mercure/health/ready,
# 60s grace, 5 retries — moves when the image moves, which is the whole
# point of not pinning it.
volumes:
- mercure_data:/data
- mercure_config:/config