-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
45 lines (37 loc) · 1.77 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
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.18
# install packages
RUN \
if [ -z ${NGINX_VERSION+x} ]; then \
NGINX_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:nginx$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
php82-pecl-mcrypt && \
echo "**** configure php-fpm to pass env vars ****" && \
sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php82/php-fpm.d/www.conf && \
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf
RUN apk --no-cache add \
# Database
php82-sqlite3 \
# Memcache
memcached \
php82-pecl-memcached
# healthchecks
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --start-interval=10s --retries=5 \
CMD curl -f http://localhost/health.html > /dev/null || exit 1
# add local files
COPY root/ /
ARG COMMIT=unknown
ARG COMMITS=0
ARG BRANCH=unknown
ARG COMMIT_MSG=unknown
RUN echo -e "\n//-- DOCKERFILE DEFINES" >> /app/www/public/includes/constants.php \
&& echo "define('DOCKERFILE_BUILD_DATE', '${BUILD_DATE}');" >> /app/www/public/includes/constants.php \
&& echo "define('DOCKERFILE_COMMIT', '${COMMIT}');" >> /app/www/public/includes/constants.php \
&& echo "define('DOCKERFILE_COMMITS', '${COMMITS}');" >> /app/www/public/includes/constants.php \
&& echo "define('DOCKERFILE_BRANCH', '${BRANCH}');" >> /app/www/public/includes/constants.php
# ports and volumes
EXPOSE 80 443
VOLUME /config