mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #270] include a healthcheck binary for use in a docker compose environment #177
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rgl on GitHub (Mar 28, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/270
in order to have a healthcheck in docker compose we need a command that returns a 0 exit code.
we either need a mailpit sub-command or an http client (e.g.
curl) binary available inside the container.for example, this docker compose file, uses
curl(but a better approach would be to implement something equivalent of this example, but as a mailpit sub-command, e.g.,mailpit readyz):with this in place, we can use
docker compose up --wait, to make it wait for all the containers/services within the docker compose environment to being healthy.@axllent commented on GitHub (Mar 28, 2024):
Thanks for the input @rgl, I'll look into this. The easiest solution would be to add curl to the Docker image - but I do see the benefits of a subcommand with a limited set of arguments, more specifically the listening interface & port (both as a commandline option and existing ENV variables). This way the docker image would only need to run
mailpit ready(or similar) and return the exit status.@axllent commented on GitHub (Mar 30, 2024):
This has been released in v1.15.1. I added a
readyzsubcommand which, in Docker, should auto-detect the port, webroot and HTTPS status of the running daemon. I also added this to the Dockerfile so you probably do not need to specify your own (unless you wish to use different defaults) 👍Please confirm it works as you expect?
@rgl commented on GitHub (Mar 30, 2024):
It works as expected! Thank you!