Dockerfile 3.8 KB

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