From deb99f9b104c230e024a910192725316ae022dcb Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 9 Sep 2019 21:22:54 +1000 Subject: [PATCH] Update PHP and add php.ini, change ssmtp to msmtp --- .gitlab-ci.yml | 1 + Dockerfile | 18 ++++++++++++++---- msmtprc | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) mode change 100755 => 100644 .gitlab-ci.yml create mode 100644 msmtprc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml old mode 100755 new mode 100644 index ccbc070..d488a49 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,7 @@ x86_64:build: stage: build script: - if [ -f init ]; then chmod 500 init; fi + - ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true" - docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true - docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} . - docker push ${CI_REGISTRY_IMAGE}:${VERSION} diff --git a/Dockerfile b/Dockerfile index 9eb42cb..8918e67 100755 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,24 @@ FROM php:7.3-fpm -RUN apt-get update && apt-get install -y openssh-server ssmtp libpq-dev unzip git libssl1.0-dev libldap-dev \ - && rm -rf /var/lib/apt/lists/* /tmp/* \ - && useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp \ - && sed -i -e 's/^mailhub=mail$/mailhub=smtp/' -e "s/^hostname=/#hostname=/" -e 's/#FromLineOverride=YES/FromLineOverride=YES/' /etc/ssmtp/ssmtp.conf +RUN apt-get update && apt-get install -y openssh-server libpq-dev unzip git libldap-dev \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +RUN useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp +RUN sed -e 's/^expose_php = On/expose_php = Off/' /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini COPY sshd_config.patch /tmp RUN (cd / && patch -p0 ) < /tmp/sshd_config.patch && rm /tmp/sshd_config.patch +RUN apt-get update && apt-get install -y msmtp \ + && apt-get -y autoremove \ + && apt-get clean \ + & rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +COPY msmtprc /etc/ +RUN sed -i -e 's#^;sendmail_path =#sendmail_path = "/usr/bin/msmtp -t"#' /usr/local/etc/php/php.ini + EXPOSE 9000/tcp 22/tcp RUN docker-php-ext-install -j$(nproc) pdo_mysql pdo_pgsql ldap gettext diff --git a/msmtprc b/msmtprc new file mode 100644 index 0000000..505acf3 --- /dev/null +++ b/msmtprc @@ -0,0 +1,18 @@ +# A system wide configuration file is optional. +# If it exists, it usually defines a default account. +# This allows msmtp to be used like /usr/sbin/sendmail. +account default + +# The SMTP smarthost +host smtp + +# Envelope-from address +#from user@example.com +domain example.com + +# Construct envelope-from addresses of the form "user@oursite.example" +#auto_from on +#maildomain example.com + +# Syslog logging with facility LOG_MAIL instead of the default LOG_USER +syslog LOG_MAIL