[GH-ISSUE #63] Add EXPOSE to Dockerfile #37

Closed
opened 2026-03-15 12:13:52 +03:00 by kerem · 2 comments
Owner

Originally created by @mdharm on GitHub (Mar 8, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/63

Some CI environments look for the list of ports exposed by a container as a way of doing a basic "health check" to verify that the container is running and ready to accept requests. GitLab is one such CI environment. Without an EXPOSE statement in the Dockerfile, the gitlab-runner has no way of checking if the mailpit container is ready to operate as a service or if more time is needed. An error is logged in this case, although it doesn't really affect operation (at least in my tests).

Simply adding the line EXPOSE 1025 8025 to Dockerfile resolves the issue. If a different set of ports is used (i.e. via --smtp or `--listen`` command-line options, then this would require changing the Dockerfile. But I see this as unlikely for a CI environment, as ports can be re-mapped between containers.

Originally created by @mdharm on GitHub (Mar 8, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/63 Some CI environments look for the list of ports exposed by a container as a way of doing a basic "health check" to verify that the container is running and ready to accept requests. GitLab is one such CI environment. Without an EXPOSE statement in the Dockerfile, the gitlab-runner has no way of checking if the mailpit container is ready to operate as a service or if more time is needed. An error is logged in this case, although it doesn't really affect operation (at least in my tests). Simply adding the line `EXPOSE 1025 8025` to `Dockerfile` resolves the issue. If a different set of ports is used (i.e. via `--smtp` or `--listen`` command-line options, then this would require changing the Dockerfile. But I see this as unlikely for a CI environment, as ports can be re-mapped between containers.
kerem closed this issue 2026-03-15 12:13:57 +03:00
Author
Owner

@axllent commented on GitHub (Mar 9, 2023):

@mdharm Thank you, you're absolutely right. I hadn't considered that as I always set the ports manually (to the same ports), but these should be open by default in the Dockerfile. This will be included in the next release.

<!-- gh-comment-id:1461189775 --> @axllent commented on GitHub (Mar 9, 2023): @mdharm Thank you, you're absolutely right. I hadn't considered that as I always set the ports manually (to the same ports), but these should be open by default in the Dockerfile. This will be included in the next release.
Author
Owner

@axllent commented on GitHub (Mar 10, 2023):

This has been included in the v.1.3.11 release. Thank you for your contribution, and please let me know if you have any issues.

<!-- gh-comment-id:1463122769 --> @axllent commented on GitHub (Mar 10, 2023): This has been included in the v.1.3.11 release. Thank you for your contribution, and please let me know if you have any issues.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#37
No description provided.