19 lines
567 B
Bash
19 lines
567 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
SOURCE_DIR=$(realpath $(dirname "${0}"))/postfix
|
||
|
# Build Docker container
|
||
|
docker build -t postfix ${SOURCE_DIR}
|
||
|
|
||
|
# Copy existing config files into persistent storage
|
||
|
mkdir -p /srv/postfix/conf /srv/postfix/data
|
||
|
chown -R 587:587 /srv/postfix/data
|
||
|
docker run --rm -v /srv/postfix/conf:/mnt/conf postfix cp -rp /etc/postfix/. /mnt/conf
|
||
|
|
||
|
# 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
|