forked from terrestris/projectsend-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ubi
62 lines (52 loc) · 2.32 KB
/
Dockerfile.ubi
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
FROM registry.access.redhat.com/ubi9/php-82:latest AS downloader
USER 0
RUN dnf install -y curl-minimal jq unzip
USER default
RUN \
if [ -z ${PROJECTSEND_VERSION+x} ]; then \
PROJECTSEND_VERSION=$(curl -s https://api.github.com/repos/projectsend/projectsend/releases/latest | jq -r '. | .tag_name'); \
fi && \
curl -fso \
/tmp/projectsend.zip -L \
"https://github.com/projectsend/projectsend/releases/download/${PROJECTSEND_VERSION}/projectsend-${PROJECTSEND_VERSION}.zip" || \
curl -fso \
/tmp/projectsend.zip -L \
"https://github.com/projectsend/projectsend/releases/download/${PROJECTSEND_VERSION}/projectsend.zip" && \
unzip \
/tmp/projectsend.zip -d \
/tmp/src && \
\
for lang in zh_CN cs nl fr de it_IT pl pt_BR ru es sw tr vi_VN; do \
curl -fso /tmp/${lang}.zip -L "https://www.projectsend.org/translations/get.php?lang=${lang}" && \
unzip -o /tmp/${lang}.zip -d /tmp/src ; \
done
RUN mkdir /tmp/php.d && \
echo -e '[global]\nmemory_limit = 512M\npost_max_size = 4096M\nupload_max_size = 4096M\nmax_execution_time = 1800' > /tmp/php.d/projectsend.ini && \
echo -e '[global]\nerror_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT\nlog_errors = 1\ndisplay_errors = 0' > /tmp/php.d/docker-log.ini
RUN mkdir /tmp/composer_temp && \
cd /tmp/composer_temp && \
curl -sSLo- https://getcomposer.org/installer | php && \
cd /tmp/src && \
php /tmp/composer_temp/composer.phar update
FROM registry.access.redhat.com/ubi9/php-82:latest AS build
COPY --from=downloader --chown=1001:0 /tmp/src /tmp/src
COPY --from=downloader --chown=1001:0 /tmp/php.d /etc/php.d
COPY ./start-ubi.sh ./php-pre-start/projectsend_parameters.sh
RUN mkdir -p /tmp/src/defaults/ && \
mv /tmp/src/upload /tmp/src/defaults/
RUN cat <<EOF >> /opt/app-root/src/.htaccess
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
Header always set X-Frame-Options "SAMEORIGIN"
Header setifempty Referrer-Policy: same-origin
Header set X-XSS-Protection "1; mode=block"
Header set X-Permitted-Cross-Domain-Policies "none"
Header set Referrer-Policy "no-referrer"
Header set X-Content-Type-Options: nosniff
ServerSignature Off
</IfModule>
EOF
RUN /usr/libexec/s2i/assemble
FROM registry.access.redhat.com/ubi9/php-82:latest AS final
COPY --from=build /opt /opt
CMD /usr/libexec/s2i/run