Dockerfile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. FROM ubuntu:xenial
  2. MAINTAINER Andre Peters <andre.peters@servercow.de>
  3. ENV DEBIAN_FRONTEND noninteractive
  4. ENV LC_ALL C
  5. RUN dpkg-divert --local --rename --add /sbin/initctl \
  6. && ln -sf /bin/true /sbin/initctl \
  7. && dpkg-divert --local --rename --add /usr/bin/ischroot \
  8. && ln -sf /bin/true /usr/bin/ischroot
  9. RUN apt-get update
  10. RUN apt-get -y install dovecot-common \
  11. dovecot-core \
  12. dovecot-imapd \
  13. dovecot-lmtpd \
  14. dovecot-managesieved \
  15. dovecot-sieve \
  16. dovecot-mysql \
  17. dovecot-pop3d \
  18. dovecot-dev \
  19. syslog-ng \
  20. syslog-ng-core \
  21. ca-certificates \
  22. supervisor \
  23. wget \
  24. curl \
  25. build-essential \
  26. autotools-dev \
  27. automake \
  28. libauthen-ntlm-perl \
  29. libcrypt-ssleay-perl \
  30. libdigest-hmac-perl \
  31. libfile-copy-recursive-perl \
  32. libio-compress-perl \
  33. libio-socket-inet6-perl \
  34. libio-socket-ssl-perl \
  35. libio-tee-perl \
  36. libmodule-scandeps-perl \
  37. libnet-ssleay-perl \
  38. libpar-packer-perl \
  39. libreadonly-perl \
  40. libterm-readkey-perl \
  41. libtest-pod-perl \
  42. libtest-simple-perl \
  43. libunicode-string-perl \
  44. liburi-perl \
  45. libdbi-perl \
  46. liblockfile-simple-perl \
  47. libdbd-mysql-perl \
  48. libipc-run-perl \
  49. make \
  50. cpanminus
  51. RUN sed -i -E 's/^(\s*)system\(\);/\1unix-stream("\/dev\/log");/' /etc/syslog-ng/syslog-ng.conf
  52. RUN cpanm Data::Uniqid Mail::IMAPClient String::Util
  53. RUN echo '* * * * * root /usr/local/bin/imapsync_cron.pl' > /etc/cron.d/imapsync
  54. RUN echo '30 3 * * * vmail /usr/bin/doveadm quota recalc -A' > /etc/cron.d/dovecot-sync
  55. WORKDIR /tmp
  56. RUN wget http://hg.dovecot.org/dovecot-antispam-plugin/archive/tip.tar.gz -O - | tar xvz \
  57. && cd /tmp/dovecot-antispam* \
  58. && ./autogen.sh \
  59. && ./configure --prefix=/usr \
  60. && make \
  61. && make install
  62. COPY ./imapsync /usr/local/bin/imapsync
  63. COPY ./postlogin.sh /usr/local/bin/postlogin.sh
  64. COPY ./imapsync_cron.pl /usr/local/bin/imapsync_cron.pl
  65. COPY ./rspamd-pipe /usr/local/bin/rspamd-pipe
  66. COPY ./docker-entrypoint.sh /
  67. COPY ./supervisord.conf /etc/supervisor/supervisord.conf
  68. RUN chmod +x /usr/local/bin/rspamd-pipe
  69. RUN chmod +x /usr/local/bin/imapsync_cron.pl
  70. RUN groupadd -g 5000 vmail
  71. RUN useradd -g vmail -u 5000 vmail -d /var/vmail
  72. EXPOSE 24 10001
  73. ENTRYPOINT ["/docker-entrypoint.sh"]
  74. CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
  75. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*