Repository navigation
Add an SMTP health check for Docker and Coolify - #2
Merged
Merged
Conversation
`python -m bridge.healthcheck` connects to the bridge's own SMTP port on loopback and sends NOOP, exiting 0 when the server answers. It never logs in or sends mail. The image declares it as its HEALTHCHECK, and it works as a Coolify command check, where an inline python -c one-liner is rejected and the default HTTP check can't test an SMTP server. Assisted-by: Claude Code:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coolify showed the bridge as
running:unknownbecause it has no health check. Coolify's default check is HTTP, which can't test an SMTP server. Its command check rejects quotes, semicolons and parentheses, so an inlinepython -cone-liner fails validation (422).This adds
python -m bridge.healthcheck:127.0.0.1:$SMTP_PORT(default 2525) and sendsNOOPThe Dockerfile declares it as the image's
HEALTHCHECK(every 30s, 10s timeout, 3 retries, 10s start period). The README has a short "Health check" section.Tested:
mainreadsSMTP_PORT, defaults to 2525. The full suite passes (66).healthy, anddocker exec … python -m bridge.healthcheckexited 0.After merge and a manual Coolify deploy, set the Coolify app's health check to type
cmd, commandpython -m bridge.healthcheck. Don't set it before deploying: the current image doesn't have the module, so the check would fail.