Dockerfile 1.8 KB

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