-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (64 loc) · 2.33 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
# final stage
FROM php:7.4.29-fpm-alpine3.14@sha256:08d205874f4a1942d9cd07e9f1490dbe5ea3a4cdb707b4e4d252ea7a3c5b8348
LABEL org.opencontainers.image.source https://github.com/digiblink/alpine-nginx-php74-pdf
LABEL org.opencontainers.image.description Alpine Linux Docker image with Nginx, PHP-FPM and wkhtmltopdf
RUN apk -u add nginx wkhtmltopdf
RUN docker-php-ext-install pdo_mysql \
&& docker-php-ext-install opcache
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/php-opocache-cfg.ini
# phalcon version setting
ARG PSR_VERSION=1.2.0
ARG PHALCON_VERSION=4.1.3
ARG PHALCON_EXT_PATH=php7/64bits
RUN set -xe && \
# install PSR
curl -LO https://github.com/jbboehr/php-psr/archive/v${PSR_VERSION}.tar.gz && \
tar xzf ${PWD}/v${PSR_VERSION}.tar.gz && \
# install Phalcon
curl -LO https://github.com/phalcon/cphalcon/archive/v${PHALCON_VERSION}.tar.gz && \
tar xzf ${PWD}/v${PHALCON_VERSION}.tar.gz && \
docker-php-ext-install -j $(getconf _NPROCESSORS_ONLN) \
${PWD}/php-psr-${PSR_VERSION} \
${PWD}/cphalcon-${PHALCON_VERSION}/build/${PHALCON_EXT_PATH} \
&& \
# remove tmp file
rm -r \
${PWD}/v${PSR_VERSION}.tar.gz \
${PWD}/php-psr-${PSR_VERSION} \
${PWD}/v${PHALCON_VERSION}.tar.gz \
${PWD}/cphalcon-${PHALCON_VERSION} \
&& \
php -m
ENV DB_HOST="" \
DB_PORT="3306" \
DB_DATABASE="" \
DB_USERNAME="" \
DB_PASSWORD=""
RUN mkdir -p /app/public
WORKDIR /app
COPY ./files/nginx.conf /etc/nginx
COPY ./files/default.conf /etc/nginx/http.d
COPY ./files/php.ini /usr/local/etc/php
COPY ./files/www.conf /usr/local/etc/php-fpm.d
COPY ./files/entrypoint.sh /entrypoint.sh
COPY ./files/index.php /app/public
RUN set -eux; \
chmod +x /entrypoint.sh; \
addgroup -g 1000 -S app; \
adduser -S -h /app -D -u 1000 -s /bin/sh app app; \
touch /var/run/nginx.pid; \
chown -R 1000:1000 /var/run/nginx.pid; \
chown -R 1000:1000 /var/lib/nginx; \
chown -R 1000:1000 /var/log/nginx; \
chown -R 1000:1000 /run/nginx; \
chown -R 1000:1000 /app
EXPOSE 8080
USER 1000
ENTRYPOINT ["/entrypoint.sh"]