Working Drupal 8 container including SSMTP.

This commit is contained in:
Torben Nehmer 2018-11-11 20:34:41 +01:00
parent e3e65adc20
commit 11451f205c
5 changed files with 34 additions and 8 deletions

View File

@ -1,4 +1,4 @@
FROM docker:8 FROM drupal:8
LABEL maintainer="Torben Nehmer <torben@nehmer.net>" LABEL maintainer="Torben Nehmer <torben@nehmer.net>"
RUN set -ex; \ RUN set -ex; \
@ -9,7 +9,7 @@ RUN set -ex; \
; \ ; \
\ \
rm -rf /var/lib/apt/lists/* ;\ rm -rf /var/lib/apt/lists/* ;\
apt-get clean ;\ apt-get clean
# Finally, publish the rootfs file into the container # Finally, publish the rootfs file into the container
# This is done as last step to make docker build caching more efficient. # This is done as last step to make docker build caching more efficient.

View File

@ -2,4 +2,4 @@
set -ex set -ex
docker build --force-rm -t nathan/docker8 -f Dockerfile build docker build --force-rm -t nathan/drupal8 -f Dockerfile build

View File

@ -3,7 +3,8 @@
set -ex set -ex
# Configuration options you usually edit go here # Configuration options you usually edit go here
# CONTAINER_WEBROOT=/var/www/html CONTAINER_SSMTPCONFDIR=/etc/ssmtp
CONTAINER_PHP_CONFD=/usr/local/etc/php/conf.d
# This is internal stuff used to build everything # This is internal stuff used to build everything
# Be aware, that several of these paths are used with rm -rf! # Be aware, that several of these paths are used with rm -rf!
@ -13,7 +14,8 @@ BUILDDIR=$(pwd)/build
SCRIPTS_SRC=${SRCDIR}/scripts SCRIPTS_SRC=${SRCDIR}/scripts
ROOTFSTREE=${TMPDIR}/tree ROOTFSTREE=${TMPDIR}/tree
ROOTFSFILE=${BUILDDIR}/rootfs.tar.gz ROOTFSFILE=${BUILDDIR}/rootfs.tar.gz
# WEBROOT_DST=${ROOTFSTREE}${CONTAINER_WEBROOT} SSMTPCONF_DST=${ROOTFSTREE}${CONTAINER_SSMTPCONFDIR}
PHP_CONFD_DST=${ROOTFSTREE}${CONTAINER_PHP_CONFD}
#### Sanitize Build Enviornment #### Sanitize Build Enviornment
if [ -d ${TMPDIR} ]; then if [ -d ${TMPDIR} ]; then
@ -27,9 +29,16 @@ fi
mkdir ${BUILDDIR} mkdir ${BUILDDIR}
#### Do the work. #### Do the work.
#
# ... # Create SSMTP config file
# mkdir -p ${SSMTPCONF_DST}
cp ${SRCDIR}/ssmtp.conf ${SSMTPCONF_DST}/ssmtp.conf
# Setup PHP
mkdir -p ${PHP_CONFD_DST}
cp ${SRCDIR}/mail.ini ${PHP_CONFD_DST}/mail.ini
# Clean up behind us # Clean up behind us
# if [ "$CLEAN_INTERMEDIATES" = true ]; then # if [ "$CLEAN_INTERMEDIATES" = true ]; then
# rm -rf ${ROUNDCUBE_SRC} # rm -rf ${ROUNDCUBE_SRC}

1
src/mail.ini Normal file
View File

@ -0,0 +1 @@
sendmail_path = "/usr/sbin/ssmtp -t -i"

16
src/ssmtp.conf Normal file
View File

@ -0,0 +1,16 @@
#
# /etc/ssmtp.conf -- a 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
# The example will fit if you are in domain.com and you mailhub is so named.
mailhub=nathan.nehmer.net
# Where will the mail seem to come from?
rewriteDomain=nehmer.net
# The full hostname
hostname=docker.nehmer.net
UseSTARTTLS=Yes