2015-03-12 16:47:56 +00:00
|
|
|
FROM ubuntu:14.10
|
2014-12-03 10:34:50 +00:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
RUN locale-gen en_GB en_GB.UTF-8 && dpkg-reconfigure locales
|
|
|
|
|
|
|
|
# Prerequisites
|
2015-07-25 01:24:55 +00:00
|
|
|
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \
|
|
|
|
apt-get update && apt-get install -y \
|
2015-03-12 16:47:56 +00:00
|
|
|
ssl-cert \
|
|
|
|
postfix \
|
2015-07-08 12:17:04 +00:00
|
|
|
dovecot-imapd && \
|
2015-03-12 16:47:56 +00:00
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2014-12-03 10:34:50 +00:00
|
|
|
|
2015-07-08 12:17:04 +00:00
|
|
|
# Postfix configuration
|
2014-12-03 10:34:50 +00:00
|
|
|
ADD ./config/postfix.main.cf /etc/postfix/main.cf
|
2014-12-03 11:03:53 +00:00
|
|
|
ADD ./config/postfix.master.cf.append /etc/postfix/master-additional.cf
|
2014-12-03 10:34:50 +00:00
|
|
|
RUN cat /etc/postfix/master-additional.cf >> /etc/postfix/master.cf
|
|
|
|
|
2015-07-08 12:17:04 +00:00
|
|
|
# Dovecot configuration
|
2014-12-03 10:34:50 +00:00
|
|
|
ADD ./config/dovecot.mail /etc/dovecot/conf.d/10-mail.conf
|
|
|
|
ADD ./config/dovecot.ssl /etc/dovecot/conf.d/10-ssl.conf
|
|
|
|
ADD ./config/dovecot.auth /etc/dovecot/conf.d/10-auth.conf
|
|
|
|
ADD ./config/dovecot.master /etc/dovecot/conf.d/10-master.conf
|
|
|
|
ADD ./config/dovecot.lda /etc/dovecot/conf.d/15-lda.conf
|
|
|
|
ADD ./config/dovecot.imap /etc/dovecot/conf.d/20-imap.conf
|
2015-07-08 09:06:43 +00:00
|
|
|
# Uncomment to add verbose logging
|
|
|
|
# ADD ./config/dovecot.logging /etc/dovecot/conf.d/10-logging.conf
|
2014-12-03 10:34:50 +00:00
|
|
|
|
2015-07-08 12:17:04 +00:00
|
|
|
# Nice place for your settings
|
|
|
|
VOLUME ["/mail_settings"]
|
|
|
|
|
2015-07-12 22:54:35 +00:00
|
|
|
# Copy boot scripts
|
2015-07-08 12:17:04 +00:00
|
|
|
COPY boot /
|
|
|
|
RUN chmod 755 /boot
|
2015-07-12 22:54:35 +00:00
|
|
|
COPY boot.d /boot.d
|
|
|
|
RUN chmod -R 755 /boot.d
|
2015-07-08 12:17:04 +00:00
|
|
|
|
|
|
|
# Volume to store email
|
|
|
|
VOLUME ["/vmail"]
|
2015-07-12 22:54:35 +00:00
|
|
|
|
2015-07-08 12:17:04 +00:00
|
|
|
# Add user vmail that ownes mail
|
|
|
|
RUN groupadd -g 5000 vmail
|
|
|
|
RUN useradd -g vmail -u 5000 vmail -d /vmail -m
|
|
|
|
|
2015-07-26 18:48:23 +00:00
|
|
|
# Redirect logs for Docker to pickup
|
|
|
|
RUN ln -sf /dev/stdout /var/log/mail.log
|
|
|
|
RUN ln -sf /dev/stdout /var/log/mail.info
|
|
|
|
RUN ln -sf /dev/stdout /var/log/mail.warn
|
|
|
|
RUN ln -sf /dev/stderr /var/log/mail.err
|
|
|
|
|
2015-07-08 09:06:43 +00:00
|
|
|
EXPOSE 25 143 587
|
2015-07-26 18:48:23 +00:00
|
|
|
ENTRYPOINT /boot; service postfix start; dovecot -F
|