infra(mailpit): use nc -z healthcheck instead of wget
The mailpit service healthcheck previously assumed `wget` ships in the axllent/mailpit image. That's true for v1.29.7 but is not part of the image's contract — a future Alpine slim-down could drop wget and silently disable the healthcheck. Switched to BusyBox `nc -z localhost 8025`, which is a TCP-port open check with no dependency beyond BusyBox itself. Verified inside axllent/mailpit:v1.29.7 that `nc` is present (/usr/bin/nc, BusyBox v1.37.0) and that the proposed command returns 0 against an open port and non-zero against a closed one. Compose still parses with `--profile staging`. Addresses @tobi's round-2 suggestion on PR #499. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -103,7 +103,11 @@ services:
|
||||
networks:
|
||||
- archive-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:8025/api/v1/info >/dev/null 2>&1 || exit 1"]
|
||||
# TCP-port open check via BusyBox `nc`. The previous wget-based probe
|
||||
# introduced a non-obvious binary dependency on the mailpit image; a
|
||||
# future tag that ships without wget would silently disable the
|
||||
# healthcheck. `nc` is part of BusyBox in the upstream image.
|
||||
test: ["CMD-SHELL", "nc -z localhost 8025 || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
Reference in New Issue
Block a user