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