This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
232 lines (194 loc) · 8.36 KB
/
Dockerfile
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
ARG DEBIAN_VERSION=11.7
FROM debian:${DEBIAN_VERSION}-slim
# ======================================================================================================================
# Package versions
# ======================================================================================================================
# MariaDB
ARG MARIADB_VERSION=10.11
# NGINX
ARG NGINX_VERSION=1.25.*
# PHP
ENV PHP_VERSION_1=7.4
ENV PHP_VERSION_2=8.0
ENV PHP_VERSION_3=8.1
ENV PHP_VERSION_4=8.2
# ======================================================================================================================
# Configuration
# ======================================================================================================================
# Timezone
ENV TZ=Europe/Berlin
# ======================================================================================================================
# Ports
# ======================================================================================================================
# NGINX
EXPOSE 80
EXPOSE 443
# BIND
EXPOSE 53
# ======================================================================================================================
# Base packages
# ======================================================================================================================
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-listchanges \
apt-transport-https \
ca-certificates
RUN sed -i 's/http:/https:/g' /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade -y --no-install-recommends
RUN apt-get install -y --no-install-recommends \
curl \
dirmngr \
gnupg2 \
locales \
locales-all \
logrotate \
lsb-release \
software-properties-common \
syslog-ng \
unattended-upgrades \
wget
# ======================================================================================================================
# Sources
# ======================================================================================================================
RUN curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add - && \
sh -c 'echo "deb https://nginx.org/packages/mainline/debian $(lsb_release -cs) nginx" > /etc/apt/sources.list.d/nginx.list'
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN wget -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.netcologne.de/mariadb/repo/${MARIADB_VERSION}/debian $(lsb_release -sc) main" > /etc/apt/sources.list.d/mariadb.list'
RUN apt-get update
# ======================================================================================================================
# Froxlor service packages
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
awstats \
bind9 \
cron \
goaccess \
jq \
letsencrypt \
libnss-extrausers \
mariadb-client \
nginx=${NGINX_VERSION} \
nscd
# ======================================================================================================================
# PHP
# ======================================================================================================================
RUN apt-get install -y --no-install-recommends \
php${PHP_VERSION_1} \
php${PHP_VERSION_1}-common \
php${PHP_VERSION_1}-bcmath \
php${PHP_VERSION_1}-bz2 \
php${PHP_VERSION_1}-cli \
php${PHP_VERSION_1}-curl \
php${PHP_VERSION_1}-fpm \
php${PHP_VERSION_1}-gd \
php${PHP_VERSION_1}-gmp \
php${PHP_VERSION_1}-imagick \
php${PHP_VERSION_1}-imap \
php${PHP_VERSION_1}-intl \
php${PHP_VERSION_1}-json \
php${PHP_VERSION_1}-mbstring \
php${PHP_VERSION_1}-mysql \
php${PHP_VERSION_1}-opcache \
php${PHP_VERSION_1}-xml \
php${PHP_VERSION_1}-zip \
php${PHP_VERSION_2} \
php${PHP_VERSION_2}-common \
php${PHP_VERSION_2}-bcmath \
php${PHP_VERSION_2}-bz2 \
php${PHP_VERSION_2}-cli \
php${PHP_VERSION_2}-curl \
php${PHP_VERSION_2}-fpm \
php${PHP_VERSION_2}-gd \
php${PHP_VERSION_2}-gmp \
php${PHP_VERSION_2}-imagick \
php${PHP_VERSION_2}-imap \
php${PHP_VERSION_2}-intl \
php${PHP_VERSION_2}-mbstring \
php${PHP_VERSION_2}-mysql \
php${PHP_VERSION_2}-opcache \
php${PHP_VERSION_2}-xml \
php${PHP_VERSION_2}-zip \
php${PHP_VERSION_3} \
php${PHP_VERSION_3}-common \
php${PHP_VERSION_3}-bcmath \
php${PHP_VERSION_3}-bz2 \
php${PHP_VERSION_3}-cli \
php${PHP_VERSION_3}-curl \
php${PHP_VERSION_3}-fpm \
php${PHP_VERSION_3}-gd \
php${PHP_VERSION_3}-gmp \
php${PHP_VERSION_3}-imagick \
php${PHP_VERSION_3}-imap \
php${PHP_VERSION_3}-intl \
php${PHP_VERSION_3}-mbstring \
php${PHP_VERSION_3}-mysql \
php${PHP_VERSION_3}-opcache \
php${PHP_VERSION_3}-xml \
php${PHP_VERSION_3}-zip \
php${PHP_VERSION_4} \
php${PHP_VERSION_4}-common \
php${PHP_VERSION_4}-bcmath \
php${PHP_VERSION_4}-bz2 \
php${PHP_VERSION_4}-cli \
php${PHP_VERSION_4}-curl \
php${PHP_VERSION_4}-fpm \
php${PHP_VERSION_4}-gd \
php${PHP_VERSION_4}-gmp \
php${PHP_VERSION_4}-imagick \
php${PHP_VERSION_4}-imap \
php${PHP_VERSION_4}-intl \
php${PHP_VERSION_4}-mbstring \
php${PHP_VERSION_4}-mysql \
php${PHP_VERSION_4}-opcache \
php${PHP_VERSION_4}-xml \
php${PHP_VERSION_4}-zip
# ======================================================================================================================
# AWStats
# ======================================================================================================================
RUN cp /usr/share/awstats/tools/awstats_buildstaticpages.pl /usr/bin/ && \
mv /etc/awstats//awstats.conf /etc/awstats//awstats.model.conf && \
sed -i.bak 's/^DirData/# DirData/' /etc/awstats//awstats.model.conf && \
sed -i.bak 's|^\\(DirIcons=\\).*$|\\1\\"/awstats-icon\\"|' /etc/awstats//awstats.model.conf && \
rm /etc/cron.d/awstats
# ======================================================================================================================
# Lib extrausers
# ======================================================================================================================
RUN mkdir -p /var/lib/extrausers && touch \
/var/lib/extrausers/passwd \
/var/lib/extrausers/group \
/var/lib/extrausers/shadow
# ======================================================================================================================
# BIND DNS
# ======================================================================================================================
RUN echo "include \"/etc/bind/froxlor_bind.conf\";" >> /etc/bind/named.conf.local && \
touch /etc/bind/froxlor_bind.conf && \
chown bind:0 /etc/bind/froxlor_bind.conf && \
chmod 0644 /etc/bind/froxlor_bind.conf
# ======================================================================================================================
# Froxlor user and group
# ======================================================================================================================
RUN groupadd -f froxlorlocal && \
useradd -s /bin/false -g froxlorlocal froxlorlocal && \
adduser www-data froxlorlocal
# ======================================================================================================================
# Filesystem
# ======================================================================================================================
RUN mkdir -p \
/etc/ssl/froxlor \
# /opt/froxlor \
/var/customers/logs \
/var/customers/mail \
/var/customers/webs \
/var/customers/tmp \
/var/www/froxlor
#RUN wget -O /opt/froxlor/froxlor-latest.tar.gz https://files.froxlor.org/releases/froxlor-latest.tar.gz && \
# tar xvfz /opt/froxlor/froxlor-latest.tar.gz && \
# rm /opt/froxlor/froxlor-latest.tar.gz
COPY ./src/ /
# ======================================================================================================================
# Entrypoint
# ======================================================================================================================
ENTRYPOINT ["bash", "/start.sh"]