-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·87 lines (76 loc) · 1.91 KB
/
Dockerfile
File metadata and controls
executable file
·87 lines (76 loc) · 1.91 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# the different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
# https://docs.docker.com/compose/compose-file/#target
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG PHP_VERSION=8.2
ARG NGINX_VERSION=1.21
# "php" stage
FROM php:${PHP_VERSION}-fpm-alpine AS bdf
# persistent / runtime deps
RUN apk add --no-cache \
acl \
fcgi \
file \
gettext \
git \
freetype libpng libjpeg-turbo \
bash \
vim \
;
ARG APCU_VERSION=5.1
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
libzip-dev \
zlib-dev \
freetype-dev libpng-dev libjpeg-turbo-dev \
gmp-dev \
libxml2-dev \
; \
\
docker-php-ext-configure zip; \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg; \
docker-php-ext-install -j$(nproc) \
intl \
pdo_mysql \
zip \
pcntl \
gd \
gmp \
bcmath \
soap \
# sockets \
mysqli \
; \
pecl install \
apcu-${APCU_VERSION} \
redis \
; \
pecl clear-cache; \
docker-php-ext-enable \
# apcu \
opcache \
pdo_mysql \
redis \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-cache --virtual .api-phpexts-rundeps $runDeps; \
\
apk del .build-deps
RUN apk --no-cache update && apk --no-cache add bash
RUN wget https://get.symfony.com/cli/installer -O - | bash && mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer
# https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PATH="${PATH}:/root/.composer/vendor/bin"
WORKDIR /srv/bdf
CMD ["php-fpm"]