From 8e85bda0788e76fabafca53b028e64ed66e83eff Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Thu, 30 Mar 2017 13:53:58 +0200 Subject: [PATCH] Add MailHog container and install mhsendmail in PHP container --- bin/console | 1 + config/php/image/Dockerfile | 5 +++++ config/php/mailhog.ini | 3 +++ docker-compose.yml | 9 +++++++++ 4 files changed, 18 insertions(+) create mode 100644 config/php/mailhog.ini diff --git a/bin/console b/bin/console index 71988e2..56a4f71 100755 --- a/bin/console +++ b/bin/console @@ -267,6 +267,7 @@ installMagento() { printf "%-15s%-30s\n" "Backend" $backendURL printf "%-15s%s: %s\n" "" "Username" ${ADMIN_USERNAME} printf "%-15s%s: %s\n" "" "Password" ${ADMIN_PASSWORD} + printf "%-15s%-30s\n" "Mails" "http://${hostname}:8025/" } diff --git a/config/php/image/Dockerfile b/config/php/image/Dockerfile index fad56f5..ca1b7f8 100644 --- a/config/php/image/Dockerfile +++ b/config/php/image/Dockerfile @@ -95,3 +95,8 @@ RUN cd /tmp/ && git clone https://github.com/xdebug/xdebug.git \ && touch /usr/local/etc/php/ext-xdebug.ini \ && rm -r /tmp/xdebug \ && apt-get purge -y --auto-remove + +# Install Mailhog +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang-go +RUN mkdir /opt/go && export GOPATH=/opt/go && go get github.com/mailhog/mhsendmail +RUN touch /usr/local/etc/php/mailhog.ini diff --git a/config/php/mailhog.ini b/config/php/mailhog.ini new file mode 100644 index 0000000..e3b3128 --- /dev/null +++ b/config/php/mailhog.ini @@ -0,0 +1,3 @@ +[mail function] +sendmail_path = "/opt/go/bin/mhsendmail --smtp-addr=mailhog:1025" + diff --git a/docker-compose.yml b/docker-compose.yml index 9530164..a79249a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: - ./config/php/php.ini:/usr/local/etc/php/php.ini - ./config/php/php-fpm.conf:/usr/local/etc/php-fpm.conf - ./config/php/ext-xdebug.ini:/usr/local/etc/php/conf.d/ext-xdebug.ini + - ./config/php/mailhog.ini:/usr/local/etc/php/conf.d/mailhog.ini volumes_from: - appdata env_file: .env @@ -75,6 +76,14 @@ services: - front - back + mailhog: + image: mailhog/mailhog + ports: + - "8025:8025" + networks: + - front + - back + volumes: magento2mysqldata: driver: local