Dockerfile 3.8 KB

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