blob: bda6e07f2d37a085cff05a79ba1a6120d014228e [file] [log] [blame]
Matthias Andreas Benkard1ba53812022-12-27 17:32:58 +01001FROM debian:bullseye-slim
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +01002LABEL maintainer "The Infrastructure Company GmbH <info@servercow.de>"
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01003
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 \
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010020 dnsutils \
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010021 gnupg \
22 libsasl2-modules \
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010023 mariadb-client \
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010024 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 \
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +010035 tzdata \
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010036 && 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