Dockerfile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. FROM debian:stretch-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. libfile-copy-recursive-perl \
  35. libfile-tail-perl \
  36. libhtml-parser-perl \
  37. libio-compress-perl \
  38. libio-socket-inet6-perl \
  39. libio-socket-ssl-perl \
  40. libio-tee-perl \
  41. libipc-run-perl \
  42. libjson-webtoken-perl \
  43. liblockfile-simple-perl \
  44. libmail-imapclient-perl \
  45. libmodule-implementation-perl \
  46. libmodule-scandeps-perl \
  47. libnet-ssleay-perl \
  48. libpackage-stash-perl \
  49. libpackage-stash-xs-perl \
  50. libpar-packer-perl \
  51. libparse-recdescent-perl \
  52. libproc-processtable-perl \
  53. libreadonly-perl \
  54. libregexp-common-perl \
  55. libsys-meminfo-perl \
  56. libterm-readkey-perl \
  57. libtest-deep-perl \
  58. libtest-fatal-perl \
  59. libtest-mock-guard-perl \
  60. libtest-mockobject-perl \
  61. libtest-nowarnings-perl \
  62. libtest-pod-perl \
  63. libtest-requires-perl \
  64. libtest-simple-perl \
  65. libtest-warn-perl \
  66. libtry-tiny-perl \
  67. libunicode-string-perl \
  68. liburi-perl \
  69. libwww-perl \
  70. mysql-client \
  71. procps \
  72. python3 \
  73. python3-html2text \
  74. python3-jinja2 \
  75. python3-mysql.connector \
  76. python3-redis \
  77. redis-server \
  78. supervisor \
  79. syslog-ng \
  80. syslog-ng-core \
  81. syslog-ng-mod-redis \
  82. && apt-key adv --fetch-keys https://repo.dovecot.org/DOVECOT-REPO-GPG \
  83. && echo 'deb https://repo.dovecot.org/ce-2.3-latest/debian/stretch stretch main' > /etc/apt/sources.list.d/dovecot.list \
  84. && apt-get update \
  85. && apt-get -y --no-install-recommends install \
  86. dovecot-lua \
  87. dovecot-managesieved \
  88. dovecot-sieve \
  89. dovecot-lmtpd \
  90. dovecot-ldap \
  91. dovecot-mysql \
  92. dovecot-core \
  93. dovecot-pop3d \
  94. dovecot-imapd \
  95. dovecot-solr \
  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/*
  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 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. ENTRYPOINT ["/docker-entrypoint.sh"]
  118. CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf