Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 1 | FROM debian:bullseye-slim |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame^] | 2 | LABEL maintainer "The Infrastructure Company GmbH <info@servercow.de>" |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 3 | |
| 4 | ARG DEBIAN_FRONTEND=noninteractive |
| 5 | ENV LC_ALL C |
| 6 | |
| 7 | RUN 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 |
| 13 | RUN 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 Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame^] | 20 | dnsutils \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 21 | gnupg \ |
| 22 | libsasl2-modules \ |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame^] | 23 | mariadb-client \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 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 \ |
Matthias Andreas Benkard | d1f5b68 | 2023-11-18 13:18:30 +0100 | [diff] [blame^] | 35 | tzdata \ |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 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 | |
| 41 | COPY supervisord.conf /etc/supervisor/supervisord.conf |
| 42 | COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf |
| 43 | COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf |
| 44 | COPY postfix.sh /opt/postfix.sh |
| 45 | COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham |
| 46 | COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam |
| 47 | COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 48 | COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh |
| 49 | COPY docker-entrypoint.sh /docker-entrypoint.sh |
| 50 | |
| 51 | RUN 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 Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 55 | /usr/local/sbin/stop-supervisor.sh |
| 56 | RUN rm -rf /tmp/* /var/tmp/* |
| 57 | |
| 58 | EXPOSE 588 |
| 59 | |
| 60 | ENTRYPOINT ["/docker-entrypoint.sh"] |
| 61 | |
| 62 | CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf |