⚠️ Potential issue | 🟡 Minor
Healthcheck relies on bash-specific /dev/tcp pseudo-device.
The TCP connectivity check using echo >/dev/tcp/localhost/18789 requires bash. If the container image uses a minimal shell (e.g., busybox/ash or dash), this will fail silently.
Proposed fix using netcat or curl
healthcheck:
- test: ["CMD-SHELL", "echo >/dev/tcp/localhost/18789"]
+ test: ["CMD-SHELL", "nc -z localhost 18789 || curl -sf http://localhost:18789/health 2>/dev/null"]
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 18789 || curl -sf http://localhost:18789/health 2>/dev/null"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docker-compose.yml` at line 105, The healthcheck command "test:
[\"CMD-SHELL\", \"echo >/dev/tcp/localhost/18789\"]" relies on bash's /dev/tcp
and may fail in minimal shells; replace it with a portable TCP check using a
tool available in the image (e.g., use netcat/nc or curl): update the
healthcheck "test" entry to run "nc -zv localhost 18789" or "curl --silent
--fail http://localhost:18789" (or the equivalent invocation supported by your
image) so the check works reliably across shells.
Originally posted by @coderabbitai in #27 (comment)
Healthcheck relies on bash-specific
/dev/tcppseudo-device.The TCP connectivity check using
echo >/dev/tcp/localhost/18789requires bash. If the container image uses a minimal shell (e.g., busybox/ash or dash), this will fail silently.Proposed fix using netcat or curl
📝 Committable suggestion
🤖 Prompt for AI Agents
Originally posted by @coderabbitai in #27 (comment)