blob: e3c64987c9410213096ae4c72a195a4142a6b04d [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001FROM debian:bullseye-slim
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01002LABEL 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
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010048COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
49COPY docker-entrypoint.sh /docker-entrypoint.sh
50
51RUN chmod +x /opt/postfix.sh \
52 /usr/local/bin/rspamd-pipe-ham \
53 /usr/local/bin/rspamd-pipe-spam \
54 /usr/local/bin/whitelist_forwardinghosts.sh \
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010055 /usr/local/sbin/stop-supervisor.sh
56RUN rm -rf /tmp/* /var/tmp/*
57
58EXPOSE 588
59
60ENTRYPOINT ["/docker-entrypoint.sh"]
61
62CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf