-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
96 lines (86 loc) · 2.72 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
# docker-pluxml
#
FROM php:8.2-apache
# default ARG(s)
#
ARG pluxml__version=v5.8.9
ARG pluxml__git=https://github.com/pluxml/PluXml
ARG plxtoolbar__git=https://github.com/Pluxopolis/plxtoolbar
ARG plxmycontact__git=https://github.com/Pluxopolis/plxMyContact
# Enable apache mod_rewrite and remoteip
#
RUN set -xe; \
a2enmod rewrite; \
a2enmod remoteip
# Configure remoteip, a2enconf done later by docker-entrypoint if REMOTEIP_ENABLE=true
#
RUN set -eux; \
{ \
echo '# Allow Private IPv4 address spaces'; \
echo 'RemoteIPHeader X-Forwarded-For'; \
echo 'RemoteIPTrustedProxy 10.0.0.0/8'; \
echo 'RemoteIPTrustedProxy 172.16.0.0/12'; \
echo 'RemoteIPTrustedProxy 192.168.0.0/16'; \
echo '# Override logging options'; \
echo 'LogFormat "%v:%p %a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined'; \
echo 'LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined'; \
echo 'LogFormat "%a %l %u %t \"%r\" %>s %O" common'; \
} > /etc/apache2/conf-available/remoteip.conf
# Build php extensions
#
RUN set -xe; \
\
deps=' \
libfreetype6 \
libjpeg62-turbo \
libpng16-16 \
'; \
buildDeps=' \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
'; \
apt-get update; \
apt-get install -y --no-install-recommends $deps; \
apt-get install -y --no-install-recommends $buildDeps; \
rm -rf /var/lib/apt/lists/*; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-install -j$(nproc) gd; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps
# Clone pluxml, pluxtoolbar and plxmycontact
#
RUN set -xe; \
\
fetchDeps=' \
git \
'; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
rm -rf /var/lib/apt/lists/*; \
\
git clone -b $pluxml__version --single-branch --depth 1 $pluxml__git /var/www/html; \
git clone $plxtoolbar__git /var/www/html/plugins/plxtoolbar; \
git clone $plxmycontact__git /var/www/html/plugins/plxMyContact; \
mv /var/www/html/data /var/www/html/data.defaults; \
chown -R www-data: /var/www/html; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps
# Install ssmtp to send e-mail through a relay
#
RUN set -xe; \
\
smtpDeps=' \
msmtp \
'; \
apt-get update; \
apt-get install -y --no-install-recommends $smtpDeps; \
rm -rf /var/lib/apt/lists/*
VOLUME /var/www/html/data
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]
# Inherited
#
# EXPOSE 80
CMD ["apache2-foreground"]