Initial commit
This commit is contained in:
commit
9421f5aea8
3 changed files with 55 additions and 0 deletions
25
Dockerfile
Normal file
25
Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM debian:buster
|
||||
|
||||
EXPOSE 25 465 587
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive && \
|
||||
apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
postfix \
|
||||
postfix-ldap \
|
||||
rsyslog \
|
||||
supervisor \
|
||||
ca-certificates &&\
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
ADD entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
VOLUME /var/spool/postfix
|
||||
|
||||
#ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["supervisord"]
|
||||
|
21
entrypoint.sh
Normal file
21
entrypoint.sh
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
CHROOTSERV=$(awk '/^[0-9a-z]/ && ($5 ~ "[-yY]") { print $1; exit}' /etc/postfix/master.cf)
|
||||
|
||||
if [ -n "${CHROOTSERV}" ]; then
|
||||
echo "The service $CHROOTSERV is configured to use chroot. Please change it in master.cf" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Test config
|
||||
echo -n "Checking configuration... "
|
||||
postfix check || exit 2
|
||||
echo "OK"
|
||||
|
||||
#Create aliases
|
||||
echo -n "Creating new aliases..."
|
||||
newaliases
|
||||
echo "OK"
|
||||
|
||||
exec /usr/lib/postfix/sbin/master -c /etc/postfix -d # 2>&1
|
||||
|
9
supervisord.conf
Normal file
9
supervisord.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:rsyslog]
|
||||
command=/usr/sbin/rsyslogd -n
|
||||
|
||||
[program:postfix]
|
||||
command=/entrypoint.sh
|
||||
|
Loading…
Reference in a new issue