Skip to content

Docker docker compose with mailhog as SMTP

Nelson Moller edited this page Jul 31, 2019 · 2 revisions

Steps to get it working

Modify the docker-compose file to add the mailhog service

to the web server service add

depends_on:
  - mailer
 ...
environment:
  - WEBWORK_SMTP_SERVER=mailer

Add the new service:

mailer:
  image: mailhog/mailhog
  ports:
    - "8025:8025"

You are going to use localhost:8025 to see the web UI of the mailer service.

Modify the config for using the right port

As the smtpPort is not set by the docker-entrypoint.sh.... you get into the running container and:

sed -i -e "s/#\$mail{smtpPort} = 25;/\$mail{smtpPort} = 1025;/" webwork2/conf/site.conf