|
| 1 | +FROM php:7.0-apache |
| 2 | + |
| 3 | +LABEL description="Apache & PHP7.0 image for wordpress app with ssmtp." |
| 4 | + |
| 5 | +# install the PHP extensions we need |
| 6 | +RUN set -ex; \ |
| 7 | + \ |
| 8 | + apt-get update; \ |
| 9 | + apt-get install -y \ |
| 10 | + openssl \ |
| 11 | + libmcrypt-dev \ |
| 12 | + libjpeg-dev \ |
| 13 | + libpng-dev \ |
| 14 | + ssmtp \ |
| 15 | + mailutils \ |
| 16 | + ; \ |
| 17 | + rm -rf /var/lib/apt/lists/*; \ |
| 18 | + \ |
| 19 | + docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \ |
| 20 | + docker-php-ext-install gd mysqli pdo pdo_mysql opcache mcrypt gettext |
| 21 | + |
| 22 | +RUN apt-get install -y zlib1g-dev; \ |
| 23 | + rm -rf /var/lib/apt/lists/* ; \ |
| 24 | + docker-php-ext-install zip |
| 25 | + |
| 26 | +# set up sendmail config, see http://linux.die.net/man/5/ssmtp.conf for options |
| 27 | +RUN echo "hostname=localhost.localdomain" > /etc/ssmtp/ssmtp.conf |
| 28 | +RUN echo "root=h.rakotonjanahary@gmail.com" >> /etc/ssmtp/ssmtp.conf |
| 29 | +RUN echo "mailhub=maildev" >> /etc/ssmtp/ssmtp.conf |
| 30 | +# The above 'maildev' is the name you used for the link command |
| 31 | +# in your docker-compose file or docker link command. |
| 32 | +# Docker automatically adds that name in the hosts file |
| 33 | +# of the container you're linking MailDev to. |
| 34 | + |
| 35 | +# Set up php sendmail config |
| 36 | +RUN echo "sendmail_path=sendmail -i -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini |
| 37 | + |
| 38 | +# Fully qualified domain name configuration for sendmail on localhost. |
| 39 | +# Without this sendmail will not work. |
| 40 | +# This must match the value for 'hostname' field that you set in ssmtp.conf. |
| 41 | +RUN echo "localhost localhost.localdomain" >> /etc/hosts |
| 42 | + |
| 43 | +# set recommended PHP.ini settings |
| 44 | +# see https://secure.php.net/manual/en/opcache.installation.php |
| 45 | +RUN { \ |
| 46 | + echo 'opcache.memory_consumption=128'; \ |
| 47 | + echo 'opcache.interned_strings_buffer=8'; \ |
| 48 | + echo 'opcache.max_accelerated_files=4000'; \ |
| 49 | + echo 'opcache.revalidate_freq=2'; \ |
| 50 | + echo 'opcache.fast_shutdown=1'; \ |
| 51 | + echo 'opcache.enable_cli=1'; \ |
| 52 | + } > /usr/local/etc/php/conf.d/opcache-recommended.ini |
| 53 | + |
| 54 | +# enable apache module |
| 55 | +RUN a2enmod headers rewrite expires |
| 56 | + |
| 57 | +# Register volume |
| 58 | +VOLUME /var/www/html |
| 59 | + |
| 60 | +# apache2 foreground |
| 61 | +CMD ["apache2-foreground"] |
0 commit comments