blob: 8b913af435cdf97f2b39c38c17a932895f0708b2 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001FROM debian:buster-slim
2LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
3
4ARG DEBIAN_FRONTEND=noninteractive
5ENV LC_ALL C
6
7RUN dpkg-divert --local --rename --add /sbin/initctl \
8 && ln -sf /bin/true /sbin/initctl \
9 && dpkg-divert --local --rename --add /usr/bin/ischroot \
10 && ln -sf /bin/true /usr/bin/ischroot
11
12# Add groups and users before installing Postfix to not break compatibility
13RUN groupadd -g 102 postfix \
14 && groupadd -g 103 postdrop \
15 && useradd -g postfix -u 101 -d /var/spool/postfix -s /usr/sbin/nologin postfix \
16 && apt-get update && apt-get install -y --no-install-recommends \
17 ca-certificates \
18 curl \
19 dirmngr \
20 dnsutils \
21 gnupg \
22 libsasl2-modules \
23 mariadb-client \
24 perl \
25 postfix \
26 postfix-mysql \
27 postfix-pcre \
28 redis-tools \
29 sasl2-bin \
30 sudo \
31 supervisor \
32 syslog-ng \
33 syslog-ng-core \
34 syslog-ng-mod-redis \
35 tzdata \
36 && rm -rf /var/lib/apt/lists/* \
37 && touch /etc/default/locale \
38 && printf '#!/bin/bash\n/usr/sbin/postconf -c /opt/postfix/conf "$@"' > /usr/local/sbin/postconf \
39 && chmod +x /usr/local/sbin/postconf
40
41COPY supervisord.conf /etc/supervisor/supervisord.conf
42COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
43COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
44COPY postfix.sh /opt/postfix.sh
45COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
46COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
47COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
48COPY smtpd_last_login.sh /usr/local/bin/smtpd_last_login.sh
49COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
50COPY docker-entrypoint.sh /docker-entrypoint.sh
51
52RUN chmod +x /opt/postfix.sh \
53 /usr/local/bin/rspamd-pipe-ham \
54 /usr/local/bin/rspamd-pipe-spam \
55 /usr/local/bin/whitelist_forwardinghosts.sh \
56 /usr/local/bin/smtpd_last_login.sh \
57 /usr/local/sbin/stop-supervisor.sh
58RUN rm -rf /tmp/* /var/tmp/*
59
60EXPOSE 588
61
62ENTRYPOINT ["/docker-entrypoint.sh"]
63
64CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf