2018-01-15 20:05:33 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/postfix
|
2018-01-23 18:18:35 +01:00
|
|
|
|
2018-01-15 20:05:33 +01:00
|
|
|
# Build Docker container
|
|
|
|
docker build -t postfix ${SOURCE_DIR}
|
|
|
|
|
|
|
|
# Copy existing config files into persistent storage
|
|
|
|
mkdir -p /srv/postfix/conf /srv/postfix/data
|
2018-01-24 15:55:47 +01:00
|
|
|
docker run --rm -v /srv/postfix/conf:/mnt/conf postfix cp -rp /etc/postfix/. /mnt/conf
|
2018-01-15 20:05:33 +01:00
|
|
|
|
|
|
|
# Configure postfix
|
|
|
|
cp ${SOURCE_DIR}/srv/postfix/conf/main.cf /srv/postfix/conf/main.cf
|
|
|
|
|
|
|
|
# Configure postfix service
|
|
|
|
cp ${SOURCE_DIR}/etc/init.d/postfix /etc/init.d/postfix
|
|
|
|
rc-update add postfix boot
|
|
|
|
service postfix start
|