FROM debian:jessie MAINTAINER Robin Thoni RUN groupadd -r email --gid=7788 && useradd -r -g email --uid=7788 email RUN apt-get update &&\ apt-get install -y dovecot-imapd dovecot-pop3d dovecot-sieve dovecot-managesieved dovecot-pgsql dovecot-lmtpd exim4 &&\ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN sed -e "s/dc_eximconfig_configtype=.*/dc_eximconfig_configtype='internet'/" -i /etc/exim4/update-exim4.conf.conf &&\ sed -e "s/dc_other_hostnames=.*/dc_other_hostnames=''/" -i /etc/exim4/update-exim4.conf.conf &&\ update-exim4.conf COPY ./run.sh /run.sh RUN rm -rf /etc/dovecot/* COPY ./config/ /etc/dovecot/ COPY ./certs/ /etc/ssl/private/ VOLUME ["/var/email", "/etc/dovecot/sieve"] EXPOSE 110 143 993 995 4190 CMD ["/run.sh"]