Adds mail support in lamp images, fixes #9

This commit is contained in:
pierreozoux 2015-02-02 17:10:02 +00:00
parent 77af800cc3
commit 3b702f679b
3 changed files with 12 additions and 1 deletions

View file

@ -42,3 +42,6 @@ cp /data/hostname /etc/mailname
#put your forwarding addresses in /data/forwards.
cp /data/forwards /etc/postfix/virtual
/usr/sbin/postconf -e "virtual_alias_maps = hash:/etc/postfix/virtual"
# accept mails from docker networked machines:
/usr/sbin/postconf -e "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.42.0/24"

View file

@ -14,17 +14,21 @@ RUN apt-get update \
php5-gd \
php5-mysql \
php5-xmlrpc \
ssmtp \
&& rm -rf /var/lib/apt/lists/*
# Add image configuration and scripts
ADD default.conf /etc/apache2/sites-enabled/000-default.conf
ADD run.sh /run.sh
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini \
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini && \
sed -i "s/.*sendmail_path.*/sendmail_path = \/usr\/sbin\/ssmtp -t/g" /etc/php5/apache2/php.ini \
&& mkdir -p /app \
&& rm -rf /var/www/html \
&& ln -s /app /var/www/html \
&& a2enmod rewrite \
&& chmod 755 /run.sh
COPY ssmtp.conf /etc/ssmtp/ssmtp.conf
CMD ["/run.sh"]
EXPOSE 80

View file

@ -0,0 +1,4 @@
mailhub=172.17.42.1
root=postmaster
FromLineOverride=YES