diff --git a/Dockerfile b/Dockerfile index 0176e4e..19cbb39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# Based on official Dockerfile: https://github.com/dovecot/docker FROM alpine:3 LABEL org.opencontainers.image.authors="markus@birth-online.de" @@ -5,6 +6,8 @@ LABEL org.opencontainers.image.authors="markus@birth-online.de" ENV container=docker \ LC_ALL=C +ARG username=vmail + RUN apk add --no-cache \ tini \ dovecot \ @@ -21,9 +24,9 @@ RUN apk add --no-cache \ mkdir /conf && \ echo "!include_try /conf/*.conf" >> /etc/dovecot/dovecot.conf && \ mkdir /data && \ - addgroup -g 1000 vmail && \ - adduser -h /data -u 1000 -D -G vmail vmail && \ - chown vmail:vmail /data + addgroup -g 1000 $username && \ + adduser -h /data -u 1000 -D -G $username $username && \ + chown 1000:1000 /data COPY local.conf /conf/local.conf diff --git a/local.conf b/local.conf index 9c1a08d..8cfd218 100644 --- a/local.conf +++ b/local.conf @@ -1,4 +1,4 @@ -## You should mount /etc/dovecot if you want to +## You should mount /conf if you want to ## manage this file mail_home=/data/%Lu