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