This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
86 lines (76 loc) · 2.9 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
# INSTALLER STAGE
FROM mcstreetguy/php-builder:7.3 as installer
# Install 'imagick' php extension
RUN apk add --no-cache imagemagick-dev && \
pecl-install-extension imagick
# MAIN STAGE
FROM mcstreetguy/carrier:alpine-3.11
LABEL maintainer="security@mcstreetguy.de"
# Requirements & preparation
RUN apk add --no-cache \
acl \
apache2 \
apache2-ctl \
apache2-http2 \
curl \
git \
grep \
imagemagick \
openssh-client \
php7 \
php7-apache2 \
php7-bz2 \
php7-curl \
php7-dom \
php7-fileinfo \
php7-json \
php7-mbstring \
php7-opcache \
php7-openssl \
php7-pdo_mysql \
php7-phar \
php7-posix \
php7-session \
php7-tidy \
php7-tokenizer \
php7-xml \
php7-xmlreader \
php7-xmlwriter \
php7-zip \
unzip \
&& \
rm -rf /var/cache/apk/* && \
sed -i 's+#LoadModule rewrite_module modules/mod_rewrite.so+LoadModule rewrite_module modules/mod_rewrite.so+g' /etc/apache2/httpd.conf && \
sed -i 's+#LoadModule remoteip_module modules/mod_remoteip.so+LoadModule remoteip_module modules/mod_remoteip.so+g' /etc/apache2/httpd.conf && \
sed -i 's+#LoadModule session_module modules/mod_session.so+LoadModule session_module modules/mod_session.so+g' /etc/apache2/httpd.conf && \
sed -i 's+#LoadModule session_cookie_module modules/mod_session_cookie.so+LoadModule session_cookie_module modules/mod_session_cookie.so+g' /etc/apache2/httpd.conf && \
sed -i 's+#LoadModule session_crypto_module modules/mod_session_crypto.so+LoadModule session_crypto_module modules/mod_session_crypto.so+g' /etc/apache2/httpd.conf && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
echo "127.0.0.1 ${PUBLIC_DOMAIN}" >> /etc/hosts
# Add required files
COPY --from=installer /usr/lib/php7/modules/* /usr/lib/php7/modules/
COPY --from=installer /usr/include/php7/ext/ /usr/include/php7/ext/
COPY ./app/config/ /etc/
# Add dynamic files
COPY ./app/dynamic/Settings.yaml /var/www/neos/Configuration/
# Ports & Volumes
EXPOSE 80
VOLUME [ "/var/www/neos/Data" ]
# Setup required variable names to keep for environment isolation
ENV KEEP_ENV "PUBLIC_DOMAIN PUBLIC_PORT FLOW_CONTEXT"
# Appends Neos Version env var
ARG NEOS_VERSION="^4.3"
ENV NEOS_VERSION "${NEOS_VERSION}"
# Build arguments for database connection
ONBUILD ARG DB_HOST
ONBUILD ARG DB_NAME=db_neos
ONBUILD ARG DB_PASS
ONBUILD ARG DB_PORT=3306
ONBUILD ARG DB_USER=usr_neos
ONBUILD ENV DB_HOST "${DB_HOST}"
ONBUILD ENV DB_NAME "${DB_NAME}"
ONBUILD ENV DB_PASS "${DB_PASS}"
ONBUILD ENV DB_USER "${DB_USER}"
ONBUILD ENV DB_PORT "${DB_PORT}"
# Apply dynamic values to Neos configuration
ONBUILD RUN sed -i "s/%DB_HOST/${DB_HOST}/g s/%DB_NAME/${DB_NAME}/g s/%DB_PASS/${DB_PASS}/g s/%DB_USER/${DB_USER}/g s/%DB_PORT/${DB_PORT}/g" /var/www/neos/Configuration/Settings.yaml