diff --git a/config/ssmtpd.conf b/config/ssmtpd.conf new file mode 100644 index 0000000..3357818 --- /dev/null +++ b/config/ssmtpd.conf @@ -0,0 +1,21 @@ +# +# Config file for sSMTP sendmail +# +# The person who gets all mail for userids < 1000 +# Make this empty to disable rewriting. +root=postmaster + +# The place where the mail goes. The actual machine name is required no +# MX records are consulted. Commonly mailhosts are named mail.domain.com +mailhub=mailcatcher + +# Where will the mail seem to come from? +#rewriteDomain= + +# The full hostname +hostname=devphp + +# Are users allowed to set their own From: address? +# YES - Allow the user to specify their own From: address +# NO - Use the system generated From: address +FromLineOverride=YES diff --git a/docker-compose.yml b/docker-compose.yml index c40c45f..50d9763 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ php: - ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini links: - mariadb + - mailcatcher nginx: image: nginx:latest @@ -36,12 +37,12 @@ nginx: links: - php - - -# smtp: -# build: ./smtp -# volumes: -# - ./config/smtpd.conf:/etc/smtpd.conf -# - ./config/mailname:/etc/mailname -# expose: -# - 25 +mailcatcher: + build: ./mailcatcher + volumes: + - ./config/smtpd.conf:/etc/smtpd.conf + - ./config/mailname:/etc/mailname + expose: + - 25 + ports: + - 1080:1080 diff --git a/mailcatcher/Dockerfile b/mailcatcher/Dockerfile new file mode 100644 index 0000000..b78e1bc --- /dev/null +++ b/mailcatcher/Dockerfile @@ -0,0 +1,5 @@ +FROM ruby + +RUN gem install mailcatcher + +ENTRYPOINT ["mailcatcher", "-f", "--ip", "0.0.0.0", "--smtp-port", "25", "--no-quit"] diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 4d741cf..c133995 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -7,7 +7,7 @@ RUN cd /tmp/ && \ mv xdebug-2.4.1/* /usr/src/php/ext/xdebug/ RUN apt-get update && apt-get install -y \ - ssmtp \ + ssmtp \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ @@ -21,5 +21,6 @@ RUN apt-get update && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +COPY ../config/ssmtpd.conf /etc/ssmtp/ssmtp.conf RUN docker-php-ext-install xdebug diff --git a/smtp/Dockerfile b/smtp/Dockerfile deleted file mode 100644 index 1c512da..0000000 --- a/smtp/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:jessie -RUN echo "deb http://debian.mirrors.ovh.net/debian/ jessie-backports main" >> /etc/apt/sources.list \ - && apt-get update && apt-get install -y \ - opensmtpd/jessie-backports \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ENTRYPOINT ["/usr/sbin/smtpd", "-d"]