Skip to content

Commit 45eda5e

Browse files
b1rdexmaxhelias
authored andcommitted
1 parent 67c3a35 commit 45eda5e

File tree

1 file changed

+10
-34
lines changed

1 file changed

+10
-34
lines changed

Dockerfile

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ ENV APP_ENV=prod
2222

2323
WORKDIR /srv/app
2424

25+
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
26+
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
27+
RUN chmod +x /usr/local/bin/install-php-extensions
28+
2529
# persistent / runtime deps
2630
RUN apk add --no-cache \
2731
acl \
@@ -32,37 +36,12 @@ RUN apk add --no-cache \
3236
;
3337

3438
RUN set -eux; \
35-
apk add --no-cache --virtual .build-deps \
36-
$PHPIZE_DEPS \
37-
icu-data-full \
38-
icu-dev \
39-
libzip-dev \
40-
zlib-dev \
41-
; \
42-
\
43-
docker-php-ext-configure zip; \
44-
docker-php-ext-install -j$(nproc) \
45-
intl \
46-
zip \
47-
; \
48-
pecl install \
49-
apcu \
50-
; \
51-
pecl clear-cache; \
52-
docker-php-ext-enable \
53-
apcu \
39+
install-php-extensions \
40+
intl \
41+
zip \
42+
apcu \
5443
opcache \
55-
; \
56-
\
57-
runDeps="$( \
58-
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
59-
| tr ',' '\n' \
60-
| sort -u \
61-
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
62-
)"; \
63-
apk add --no-cache --virtual .app-phpexts-rundeps $runDeps; \
64-
\
65-
apk del .build-deps
44+
;
6645

6746
###> recipes ###
6847
###< recipes ###
@@ -125,10 +104,7 @@ RUN rm $PHP_INI_DIR/conf.d/app.prod.ini; \
125104
COPY docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
126105

127106
RUN set -eux; \
128-
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS; \
129-
pecl install xdebug; \
130-
docker-php-ext-enable xdebug; \
131-
apk del .build-deps
107+
install-php-extensions xdebug
132108

133109
RUN rm -f .env.local.php
134110

0 commit comments

Comments
 (0)