2020-10-27 11:21:10 +00:00
|
|
|
FROM debian:buster-slim
|
|
|
|
|
2020-11-07 17:43:25 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2020-10-31 17:19:13 +00:00
|
|
|
|
|
|
|
# Install packages
|
2020-10-27 11:21:10 +00:00
|
|
|
RUN \
|
|
|
|
apt-get update \
|
|
|
|
&& apt-get upgrade -y \
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
dovecot-core \
|
|
|
|
dovecot-imapd \
|
|
|
|
dovecot-lmtpd \
|
2020-11-07 17:43:25 +00:00
|
|
|
dovecot-pop3d \
|
2020-10-27 11:21:10 +00:00
|
|
|
opendkim \
|
|
|
|
opendkim-tools \
|
2020-10-31 17:19:13 +00:00
|
|
|
openssl \
|
2020-11-07 17:43:25 +00:00
|
|
|
postfix \
|
|
|
|
rsyslog \
|
|
|
|
supervisor \
|
|
|
|
telnet \
|
2020-10-27 11:21:10 +00:00
|
|
|
&& apt-get autoclean \
|
|
|
|
&& apt-get autoremove
|
|
|
|
|
2020-10-31 17:19:13 +00:00
|
|
|
# Setup folders and users
|
2020-10-27 11:21:10 +00:00
|
|
|
RUN \
|
2020-11-07 17:43:25 +00:00
|
|
|
groupadd -g 2222 vmail \
|
2020-10-31 17:19:13 +00:00
|
|
|
&& useradd -d /var/mail -M -s /usr/sbin/nologin -u 2222 -g 2222 vmail \
|
2020-10-27 11:21:10 +00:00
|
|
|
&& usermod -aG vmail postfix \
|
|
|
|
&& usermod -aG vmail dovecot \
|
|
|
|
&& usermod -aG vmail opendkim\
|
|
|
|
&& mkdir -p -m 751 /var/mail/ \
|
|
|
|
&& mkdir -p -m 755 /etc/mail/ \
|
2020-11-07 17:43:25 +00:00
|
|
|
&& chown vmail:vmail /var/mail
|
2020-10-27 11:21:10 +00:00
|
|
|
|
|
|
|
# Copy config files
|
|
|
|
COPY rootfs/ /
|
|
|
|
|
2020-10-31 17:19:13 +00:00
|
|
|
# Expose ports
|
2020-10-27 11:21:10 +00:00
|
|
|
EXPOSE 25 143 587 993
|
|
|
|
|
2020-10-31 17:19:13 +00:00
|
|
|
# Run start script
|
2020-10-27 11:21:10 +00:00
|
|
|
ENTRYPOINT /usr/bin/start.sh
|