-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.2.4
More file actions
32 lines (25 loc) · 1.71 KB
/
Dockerfile.2.4
File metadata and controls
32 lines (25 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM ghcr.io/neomediatech/ubuntu-base:24.04
ENV SERVICE=dovecot
LABEL org.opencontainers.image.source=https://github.com/Neomediatech/${SERVICE} \
org.opencontainers.package.name=dovecot-core \
it.neomediatech.app-label=dovecot
RUN apt-get update && apt-get install -y --no-install-recommends vim gpg gpg-agent apt-transport-https ssl-cert && \
curl https://repo.dovecot.org/DOVECOT-REPO-GPG-2.4 | gpg --dearmor -o /usr/share/keyrings/dovecot.gpg && \
echo 'deb [signed-by=/usr/share/keyrings/dovecot.gpg] https://repo.dovecot.org/ce-2.4-latest/ubuntu/noble noble main' > /etc/apt/sources.list.d/dovecot.list && \
apt-get update && apt-get install -y --no-install-recommends dovecot-core dovecot-imapd dovecot-lmtpd dovecot-mysql dovecot-pop3d dovecot-sieve dovecot-sqlite dovecot-submissiond && \
groupadd -g 5000 vmail && useradd -u 5000 -g 5000 vmail -d /srv/vmail && passwd -l vmail && \
cp -ar /etc/dovecot /etc/dovecot.orig && \
rm -rf /etc/dovecot && mkdir /srv/mail && chown vmail:vmail /srv/mail && \
make-ssl-cert generate-default-snakeoil && \
mkdir /etc/dovecot && ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/dovecot/fullchain.pem && \
ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/dovecot/privkey.pem && \
apt-get clean && rm -rf /var/lib/apt/lists/*
COPY dovecot.conf.2.4 /etc/dovecot/dovecot.conf
COPY dovecot-ssl.cnf /etc/dovecot/
COPY entrypoint.sh /
COPY bin/* /usr/local/sbin/
RUN chmod +x /entrypoint.sh /usr/local/sbin/*
EXPOSE 110 143 993 995
HEALTHCHECK --interval=10s --timeout=5s --start-period=90s --retries=5 CMD doveadm service status 1>/dev/null && echo 'At your service, sir' || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/tini", "--", "dovecot","-F"]