2019-08-09 20:08:58 +08:00
|
|
|
FROM debian:buster-slim
|
2017-05-13 21:33:32 +08:00
|
|
|
LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2017-05-13 22:29:18 +08:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
2017-03-02 18:23:23 +08:00
|
|
|
ENV LC_ALL C
|
|
|
|
|
|
|
|
RUN dpkg-divert --local --rename --add /sbin/initctl \
|
|
|
|
&& ln -sf /bin/true /sbin/initctl \
|
|
|
|
&& dpkg-divert --local --rename --add /usr/bin/ischroot \
|
|
|
|
&& ln -sf /bin/true /usr/bin/ischroot
|
|
|
|
|
2019-08-09 20:08:58 +08:00
|
|
|
# Add groups and users before installing Postfix to not break compatibility
|
|
|
|
RUN groupadd -g 102 postfix \
|
|
|
|
&& groupadd -g 103 postdrop \
|
|
|
|
&& useradd -g postfix -u 101 -d /var/spool/postfix -s /usr/sbin/nologin postfix \
|
|
|
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
2017-05-13 22:07:06 +08:00
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
dirmngr \
|
2019-11-27 05:56:20 +08:00
|
|
|
dnsutils \
|
2017-05-13 22:07:06 +08:00
|
|
|
gnupg \
|
2017-03-02 18:23:23 +08:00
|
|
|
libsasl2-modules \
|
2019-08-09 20:08:58 +08:00
|
|
|
mariadb-client \
|
2018-04-26 20:06:10 +08:00
|
|
|
perl \
|
2017-03-02 18:23:23 +08:00
|
|
|
postfix \
|
|
|
|
postfix-mysql \
|
|
|
|
postfix-pcre \
|
2017-05-13 22:07:06 +08:00
|
|
|
sasl2-bin \
|
|
|
|
sudo \
|
|
|
|
supervisor \
|
2017-03-02 18:23:23 +08:00
|
|
|
syslog-ng \
|
|
|
|
syslog-ng-core \
|
2017-05-13 02:54:23 +08:00
|
|
|
syslog-ng-mod-redis \
|
2018-07-17 06:29:07 +08:00
|
|
|
tzdata \
|
2017-07-11 23:09:20 +08:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2018-01-24 16:10:43 +08:00
|
|
|
&& touch /etc/default/locale \
|
|
|
|
&& printf '#!/bin/bash\n/usr/sbin/postconf -c /opt/postfix/conf "$@"' > /usr/local/sbin/postconf \
|
|
|
|
&& chmod +x /usr/local/sbin/postconf
|
2017-04-06 04:19:41 +08:00
|
|
|
|
2017-03-02 18:23:23 +08:00
|
|
|
COPY supervisord.conf /etc/supervisor/supervisord.conf
|
2017-05-07 05:42:18 +08:00
|
|
|
COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
2020-02-05 17:58:04 +08:00
|
|
|
COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
|
2017-03-02 18:23:23 +08:00
|
|
|
COPY postfix.sh /opt/postfix.sh
|
2018-07-29 06:35:54 +08:00
|
|
|
COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
|
|
|
|
COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
|
2017-04-24 01:38:47 +08:00
|
|
|
COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
|
2018-10-26 04:35:07 +08:00
|
|
|
COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
|
2020-02-05 17:58:04 +08:00
|
|
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
2018-10-26 04:35:07 +08:00
|
|
|
|
|
|
|
RUN chmod +x /opt/postfix.sh \
|
|
|
|
/usr/local/bin/rspamd-pipe-ham \
|
|
|
|
/usr/local/bin/rspamd-pipe-spam \
|
|
|
|
/usr/local/bin/whitelist_forwardinghosts.sh \
|
|
|
|
/usr/local/sbin/stop-supervisor.sh
|
2020-02-05 17:58:04 +08:00
|
|
|
RUN rm -rf /tmp/* /var/tmp/*
|
2017-03-02 18:23:23 +08:00
|
|
|
|
|
|
|
EXPOSE 588
|
|
|
|
|
2020-02-05 17:58:04 +08:00
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
2017-03-02 18:23:23 +08:00
|
|
|
|
2020-02-05 17:58:04 +08:00
|
|
|
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
|