Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame^] | 1 | FROM debian:buster-slim |
| 2 | LABEL maintainer "Andre Peters <andre.peters@servercow.de>" |
| 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 \ |
| 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 | |
| 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 |
| 48 | COPY smtpd_last_login.sh /usr/local/bin/smtpd_last_login.sh |
| 49 | COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh |
| 50 | COPY docker-entrypoint.sh /docker-entrypoint.sh |
| 51 | |
| 52 | RUN 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 |
| 58 | RUN rm -rf /tmp/* /var/tmp/* |
| 59 | |
| 60 | EXPOSE 588 |
| 61 | |
| 62 | ENTRYPOINT ["/docker-entrypoint.sh"] |
| 63 | |
| 64 | CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf |