Dockerfile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. FROM debian:bullseye-slim
  2. LABEL maintainer "Andre Peters <andre.peters@servercow.de>"
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. ARG DOVECOT=2.3.19.1
  5. ENV LC_ALL C
  6. ENV GOSU_VERSION 1.14
  7. # Add groups and users before installing Dovecot to not break compatibility
  8. RUN groupadd -g 5000 vmail \
  9. && groupadd -g 401 dovecot \
  10. && groupadd -g 402 dovenull \
  11. && groupadd -g 999 sogo \
  12. && usermod -a -G sogo nobody \
  13. && useradd -g vmail -u 5000 vmail -d /var/vmail \
  14. && useradd -c "Dovecot unprivileged user" -d /dev/null -u 401 -g dovecot -s /bin/false dovecot \
  15. && useradd -c "Dovecot login user" -d /dev/null -u 402 -g dovenull -s /bin/false dovenull \
  16. && touch /etc/default/locale \
  17. && apt-get update \
  18. && apt-get -y --no-install-recommends install \
  19. apt-transport-https \
  20. ca-certificates \
  21. cpanminus \
  22. curl \
  23. dnsutils \
  24. dirmngr \
  25. gettext \
  26. gnupg2 \
  27. jq \
  28. libauthen-ntlm-perl \
  29. libcgi-pm-perl \
  30. libcrypt-openssl-rsa-perl \
  31. libcrypt-ssleay-perl \
  32. libdata-uniqid-perl \
  33. libdbd-mysql-perl \
  34. libdbi-perl \
  35. libdigest-hmac-perl \
  36. libdist-checkconflicts-perl \
  37. libencode-imaputf7-perl \
  38. libfile-copy-recursive-perl \
  39. libfile-tail-perl \
  40. libhtml-parser-perl \
  41. libio-compress-perl \
  42. libio-socket-inet6-perl \
  43. libio-socket-ssl-perl \
  44. libio-tee-perl \
  45. libipc-run-perl \
  46. libjson-webtoken-perl \
  47. liblockfile-simple-perl \
  48. libmail-imapclient-perl \
  49. libmodule-implementation-perl \
  50. libmodule-scandeps-perl \
  51. libnet-ssleay-perl \
  52. libpackage-stash-perl \
  53. libpackage-stash-xs-perl \
  54. libpar-packer-perl \
  55. libparse-recdescent-perl \
  56. libproc-processtable-perl \
  57. libreadonly-perl \
  58. libregexp-common-perl \
  59. libsys-meminfo-perl \
  60. libterm-readkey-perl \
  61. libtest-deep-perl \
  62. libtest-fatal-perl \
  63. libtest-mock-guard-perl \
  64. libtest-mockobject-perl \
  65. libtest-nowarnings-perl \
  66. libtest-pod-perl \
  67. libtest-requires-perl \
  68. libtest-simple-perl \
  69. libtest-warn-perl \
  70. libtry-tiny-perl \
  71. libunicode-string-perl \
  72. liburi-perl \
  73. libwww-perl \
  74. lua-sql-mysql \
  75. lua-socket \
  76. mariadb-client \
  77. procps \
  78. python3-pip \
  79. redis-server \
  80. supervisor \
  81. syslog-ng \
  82. syslog-ng-core \
  83. syslog-ng-mod-redis \
  84. wget \
  85. && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
  86. && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
  87. && chmod +x /usr/local/bin/gosu \
  88. && gosu nobody true \
  89. && apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG \
  90. && echo "deb https://repo.dovecot.org/ce-${DOVECOT}/debian/bullseye bullseye main" > /etc/apt/sources.list.d/dovecot.list \
  91. && apt-get update \
  92. && apt-get -y --no-install-recommends install \
  93. dovecot-lua \
  94. dovecot-managesieved \
  95. dovecot-sieve \
  96. dovecot-lmtpd \
  97. dovecot-ldap \
  98. dovecot-mysql \
  99. dovecot-core \
  100. dovecot-pop3d \
  101. dovecot-imapd \
  102. dovecot-solr \
  103. && pip3 install mysql-connector-python html2text jinja2 redis \
  104. && apt-get autoremove --purge -y \
  105. && apt-get autoclean \
  106. && rm -rf /var/lib/apt/lists/* \
  107. && rm -rf /tmp/* /var/tmp/* /root/.cache/
  108. COPY trim_logs.sh /usr/local/bin/trim_logs.sh
  109. COPY clean_q_aged.sh /usr/local/bin/clean_q_aged.sh
  110. COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
  111. COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
  112. COPY imapsync /usr/local/bin/imapsync
  113. COPY imapsync_runner.pl /usr/local/bin/imapsync_runner.pl
  114. COPY report-spam.sieve /usr/lib/dovecot/sieve/report-spam.sieve
  115. COPY report-ham.sieve /usr/lib/dovecot/sieve/report-ham.sieve
  116. COPY rspamd-pipe-ham /usr/lib/dovecot/sieve/rspamd-pipe-ham
  117. COPY rspamd-pipe-spam /usr/lib/dovecot/sieve/rspamd-pipe-spam
  118. COPY sa-rules.sh /usr/local/bin/sa-rules.sh
  119. COPY maildir_gc.sh /usr/local/bin/maildir_gc.sh
  120. COPY docker-entrypoint.sh /
  121. COPY supervisord.conf /etc/supervisor/supervisord.conf
  122. COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
  123. COPY quarantine_notify.py /usr/local/bin/quarantine_notify.py
  124. COPY quota_notify.py /usr/local/bin/quota_notify.py
  125. COPY repl_health.sh /usr/local/bin/repl_health.sh
  126. ENTRYPOINT ["/docker-entrypoint.sh"]
  127. CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf