FROM php:fpm
RUN echo "nullmailer shared/mailname string ruscourse.ru" | debconf-set-selections \
&& echo "nullmailer nullmailer/relayhost string mail.autosys.tk smtp" | debconf-set-selections \
&& echo "nullmailer nullmailer/adminaddr string mike@autosys.tk" | debconf-set-selections \
&& echo "nullmailer nullmailer/defaultdomain string autosys.tk" | debconf-set-selections \
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
nullmailer \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libicu-dev \
libldap2-dev \
libxml2-dev \
libxslt1-dev \
libwebp-dev \
libxpm-dev \
libpq-dev \
&& CFLAGS="-I/usr/src/php" docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir \
--with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir \
&& CFLAGS="-I/usr/src/php" docker-php-ext-install -j$(nproc) pcntl exif gd \
calendar gettext intl ldap shmop sockets sysvmsg \
sysvsem sysvshm tokenizer xml xmlreader xmlwriter xsl \
pdo pdo_pgsql \
&& apt-get clean \
&& rm -Rf /var/www/* \
&& chown -R www-data:www-data /var/www \
&& sed -i '/sendmail_path/ s/=.*$/= "\/usr\/sbin\/sendmail -f mike@autosys.tk -t -i"/' /usr/local/etc/php/php.ini-production \
&& sed -i '/sendmail_path/ s/^.*;//' /usr/local/etc/php/php.ini-production \
&& mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini \
&& sed -i '/exec/ s/^/service nullmailer start \& /' /usr/local/bin/docker-php-entrypoint
Discussion