mailhog / MailHog

Web and API based SMTP testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document configuring mailhog via Docker

jericopulvera opened this issue · comments

How do I configure mailhog via Docker? I would like to add auth but I have trouble figuring it out.

Found a docker-compose example on
https://technotrampoline.com/articles/how-to-intercept-nodemailer-emails-with-mailhog/
Check it out may be it is something for you.

version: "3"
services:
  mailhog:
    image: "mailhog/mailhog"
    container_name: "mailhog"
    ports:
      - 8025:8025
      - 1025:1025

Please have a look at this issue, it shares the compose file including the injection of the auth file and setting the environment variable.

Another approach would be to create your own Dockerfile, copy your auth file to the container and set the environment variable with the Dockerfile ENV command.

This could then look like:

FROM mailhog/mailhog:v1.0.1

WORKDIR /conf/
COPY auth.file .

ENV MH_AUTH_FILE=/conf/auth.file