-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
68 lines (56 loc) · 1.82 KB
/
Dockerfile.server
File metadata and controls
68 lines (56 loc) · 1.82 KB
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
FROM dunglas/frankenphp
# FROM dunglas/frankenphp-latest
# FROM dunglas/frankenphp-1.1
# https://hub.docker.com/r/dunglas/frankenphp/tags
ARG SERV_NAME
ENV SERVER_NAME=${SERV_NAME}
#
# Tools
#
RUN apt-get update && \
apt-get -y install git 7zip zip supervisor
#
# Setup PHP
#
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
zip \
opcache
RUN mkdir -p /container_data
ARG VIKTOR_ROOT
COPY ${VIKTOR_ROOT}/docker-data /container_data/
#
# Setup PHP
# copy over the needed php.ini from original server
# and move the custom to the correct position
#
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini
RUN mv /container_data/php.ini $PHP_INI_DIR/conf.d/project-php.ini
#
# Setup Caddy
#
# To make Mercure accessible we copy in a modified Caddyfile
# this file is taken from dunglas/frankenphp image
# need to check from time to time, if something changes
# maybe find a better solution
#
ARG MERCURE_ENABLE
ARG MERCURE_KEY
ENV MERCURE_PUBLISHER_JWT_KEY=${MERCURE_KEY}
ENV MERCURE_SUBSCRIBER_JWT_KEY=${MERCURE_KEY}
RUN if [ "$MERCURE_ENABLE" = "1" ]; then \
cp /container_data/Caddyfile /etc/caddy/Caddyfile \
;fi
#
# composer
#
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');" && \
mv composer.phar /usr/local/bin/composer
# workermode: still in testing
# ENV FRANKENPHP_CONFIG="worker /app/public/index.php"
ENTRYPOINT ["/container_data/entrypoint.sh", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]