This repository was archived by the owner on Feb 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
157 lines (121 loc) · 5.52 KB
/
Copy pathDockerfile
File metadata and controls
157 lines (121 loc) · 5.52 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
ARG DEBIAN_VERSION=11.7
FROM debian:${DEBIAN_VERSION}-slim
# ======================================================================================================================
# Package versions
# ======================================================================================================================
# MariaDB
ARG MARIADB_VERSION=10.11
# ======================================================================================================================
# Configuration
# ======================================================================================================================
# System
ENV TZ 'Europe/Berlin'
# Froxlor
ENV FRX_MAIL_DIR '/var/customers/mail'
ENV FRX_DB_HOST 'localhost'
ENV FRX_DB_NAME 'froxlor'
ENV FRX_DB_USER 'froxlor'
ENV FRX_DB_PASSWORD ''
# Postfix/Dovecot
ENV MAIL_DOMAIN 'example.com'
ENV MESSAGE_SIZE_LIMIT 52428800
ENV MY_NETWORKS '127.0.0.0/8'
ENV POSTMASTER_MAIL 'postmaster@example.com'
ENV ROOT_MAIL 'root@example.com'
# Mailbox cleanup
ENV CLEANUP_TRASH 7
ENV CLEANUP_SPAM 14
# ======================================================================================================================
# Ports
# ======================================================================================================================
# SMTP
EXPOSE 25
# SMTPS
EXPOSE 465
# POP
EXPOSE 110
# IMAP
EXPOSE 143
# POPS
EXPOSE 993
# IMAPS
EXPOSE 995
# Sieve
EXPOSE 4190
# ======================================================================================================================
# Common packages
# ======================================================================================================================
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends
RUN apt-get install -y --no-install-recommends \
apt-listchanges \
apt-transport-https \
ca-certificates \
curl \
logrotate \
gettext-base \
syslog-ng \
unattended-upgrades
# ======================================================================================================================
# Sources
# ======================================================================================================================
RUN curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 'https://mariadb.org/mariadb_release_signing_key.asc' && \
sh -c "echo 'deb https://mirror.23m.com/mariadb/repo/${MARIADB_VERSION}/debian bullseye main' >> /etc/apt/sources.list"
RUN apt-get update
# ======================================================================================================================
# Database
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
mariadb-client
# ======================================================================================================================
# Postfix
# ======================================================================================================================
# Pre-seeding for Postfix installation
RUN echo "postfix postfix/mailname string mail.example.com" | debconf-set-selections && \
echo "postfix postfix/main_mailer_type string 'No configuration'" | debconf-set-selections
RUN apt-get install -y --no-install-recommends \
postfix \
postfix-mysql
# ======================================================================================================================
# Dovecot
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
dovecot-mysql \
dovecot-imapd \
dovecot-pop3d \
dovecot-sieve \
dovecot-managesieved \
libsasl2-modules \
sasl2-bin
# Create Sieve folder
RUN mkdir -p ${FRX_MAIL_DIR}/.sieve/.before
# ======================================================================================================================
# Postfix & Dovecot configuration
# ======================================================================================================================
# Create mail user and group
RUN groupadd -g 2000 vmail && \
useradd -u 2000 -g vmail vmail
# Set rights
RUN chown -R 2000:2000 ${FRX_MAIL_DIR} && \
chmod -R 0750 ${FRX_MAIL_DIR}
# ======================================================================================================================
# SpamAssassin
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
spamc
# Create user and group
RUN groupadd debian-spamd && \
useradd -g debian-spamd debian-spamd
# ======================================================================================================================
# Trash & Spam cleanup
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
cron
# ======================================================================================================================
# Filesystem
# ======================================================================================================================
COPY ./src/ /
# ======================================================================================================================
# Entrypoint
# ======================================================================================================================
ENTRYPOINT ["bash", "/start.sh"]