Dockerfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. FROM debian:bookworm-slim
  2. LABEL maintainer = "The Infrastructure Company GmbH <info@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. dnsutils \
  18. gnupg \
  19. libsasl2-modules \
  20. mariadb-client \
  21. perl \
  22. postfix \
  23. postfix-mysql \
  24. postfix-pcre \
  25. redis-tools \
  26. sasl2-bin \
  27. sudo \
  28. supervisor \
  29. syslog-ng \
  30. syslog-ng-core \
  31. syslog-ng-mod-redis \
  32. tzdata \
  33. && rm -rf /var/lib/apt/lists/* \
  34. && touch /etc/default/locale \
  35. && printf '#!/bin/bash\n/usr/sbin/postconf -c /opt/postfix/conf "$@"' > /usr/local/sbin/postconf \
  36. && chmod +x /usr/local/sbin/postconf
  37. COPY supervisord.conf /etc/supervisor/supervisord.conf
  38. COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
  39. COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
  40. COPY postfix.sh /opt/postfix.sh
  41. COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
  42. COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
  43. COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
  44. COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
  45. COPY docker-entrypoint.sh /docker-entrypoint.sh
  46. RUN chmod +x /opt/postfix.sh \
  47. /usr/local/bin/rspamd-pipe-ham \
  48. /usr/local/bin/rspamd-pipe-spam \
  49. /usr/local/bin/whitelist_forwardinghosts.sh \
  50. /usr/local/sbin/stop-supervisor.sh
  51. RUN rm -rf /tmp/* /var/tmp/*
  52. EXPOSE 588
  53. ENTRYPOINT ["/docker-entrypoint.sh"]
  54. CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]