Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile HEALTHCHECK vs configuring the host/port for the web interface vs IPv4/IPv6 #407

Open
ankon opened this issue Apr 6, 2022 · 2 comments · May be fixed by #409
Open

Dockerfile HEALTHCHECK vs configuring the host/port for the web interface vs IPv4/IPv6 #407

ankon opened this issue Apr 6, 2022 · 2 comments · May be fixed by #409

Comments

@ankon
Copy link

ankon commented Apr 6, 2022

The healthcheck is configured to check "localhost:1080", which works iff the web interface is bound to port 1080 and "whatever-localhost-resolves-to".

Unfortunately this breaks for me (Intel mac + podman):

  1. The default bind host is 0.0.0.0 (see
    host = host || '0.0.0.0'
    )
  2. podman sets up the world to support IPv4 and IPv6
  3. The maildev container has/receives a /etc/hosts that resolves localhost to both 127.0.0.1 and ::1
  4. wget (and/or the underlying libc) has a preference for using IPv6 when it is available:

Log from wget (trimmed a bit to remove podman-compose noise):

$ podman-compose exec maildev wget -O - http://localhost:1080/healthz
Connecting to localhost:1080 ([::1]:1080)
wget: can't connect to remote host: Connection refused
exit code: 1

Workaround

I can set MAILDEV_WEB_IP to ::.

Expectation

"Things work just fine". But, that's not trivial I think:

  1. The healthcheck config would need to know what the user configured?
  2. IPv4/IPv6 is still quite confusing, and the goal of the project seems to be ease-of-use

So maybe this could be instead added to the documentation?

@michael-sanders
Copy link

The healthcheck also fails if you set the base-pathname to a non-default value via the --base-pathname option (or MAILDEV_BASE_PATHNAME env var).

@AndreasScharfCPB
Copy link

Same here. If I configure the ports via environment variable in a docker-compose file the healthcheck checks the wrong port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants