Skip to content

augustash/docker-alpine-mailhog

Repository files navigation

Alpine MailHog Image

https://www.augustash.com

This base container is not currently aimed at public consumption. It exists as a starting point for August Ash containers.

Versions

See VERSIONS.md for image contents.

Usage

Launch a MailHog container that can act as a development SMTP server with an HTTP interface:

docker run --rm \
    -p 8025:8025 \
    -p 1025:1025 \
    --net <NETWORK NAME> \
    augustash/alpine-mailhog

PHP Sendmail

You must direct email to the running container and that can be done by SMTP or sendmail for PHP applications.

For example, in your php.ini configuration you can use the following line:

sendmail_path = /usr/sbin/sendmail -S <CONTAINER NAME/IP>:1025

Alternatively you can look into MailHog's sendmail replacement called mhsendmail. If installed, it can be used like this:

sendmail_path = /usr/local/go/bin/mhsendmail --smtp-addr <CONTAINER NAME/IP>:1025

Web UI

Once running and capturing email, you can view the messages using the Web UI. If using the default hostname/ports, open a browser and visit MailHog Web UI.

User/Group Identifiers

To help avoid nasty permissions errors, the container allows you to specify your own PUID and PGID. This can be a user you've created or even root (not recommended).

Environment Variables

The following variables can be set and will change how the container behaves. You can use the -e flag, an environment file, or your Docker Compose file to set your preferred values. The default values are shown:

  • PUID=501
  • PGID=1000
  • MAIL_STORAGE=memory
  • MAIL_SMTP_PORT=1025
  • MAIL_API_PORT=8025
  • MAIL_HOSTNAME=mailhog.test
  • MAIL_PARAMS=

About

An Alpine-based MailHog container with S6-Overlay used for August Ash initiatives.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published