Use php extensions installer
https://github.com/mlocati/docker-php-extension-installer Fixes https://github.com/dunglas/symfony-docker/issues/276
This commit is contained in:
parent
67c3a35795
commit
45eda5e683
44
Dockerfile
44
Dockerfile
@ -22,6 +22,10 @@ ENV APP_ENV=prod
|
|||||||
|
|
||||||
WORKDIR /srv/app
|
WORKDIR /srv/app
|
||||||
|
|
||||||
|
# php extensions installer: https://github.com/mlocati/docker-php-extension-installer
|
||||||
|
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||||
|
RUN chmod +x /usr/local/bin/install-php-extensions
|
||||||
|
|
||||||
# persistent / runtime deps
|
# persistent / runtime deps
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
acl \
|
acl \
|
||||||
@ -32,37 +36,12 @@ RUN apk add --no-cache \
|
|||||||
;
|
;
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache --virtual .build-deps \
|
install-php-extensions \
|
||||||
$PHPIZE_DEPS \
|
intl \
|
||||||
icu-data-full \
|
zip \
|
||||||
icu-dev \
|
apcu \
|
||||||
libzip-dev \
|
|
||||||
zlib-dev \
|
|
||||||
; \
|
|
||||||
\
|
|
||||||
docker-php-ext-configure zip; \
|
|
||||||
docker-php-ext-install -j$(nproc) \
|
|
||||||
intl \
|
|
||||||
zip \
|
|
||||||
; \
|
|
||||||
pecl install \
|
|
||||||
apcu \
|
|
||||||
; \
|
|
||||||
pecl clear-cache; \
|
|
||||||
docker-php-ext-enable \
|
|
||||||
apcu \
|
|
||||||
opcache \
|
opcache \
|
||||||
; \
|
;
|
||||||
\
|
|
||||||
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 .app-phpexts-rundeps $runDeps; \
|
|
||||||
\
|
|
||||||
apk del .build-deps
|
|
||||||
|
|
||||||
###> recipes ###
|
###> recipes ###
|
||||||
###< recipes ###
|
###< recipes ###
|
||||||
@ -125,10 +104,7 @@ RUN rm $PHP_INI_DIR/conf.d/app.prod.ini; \
|
|||||||
COPY docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
|
COPY docker/php/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS; \
|
install-php-extensions xdebug
|
||||||
pecl install xdebug; \
|
|
||||||
docker-php-ext-enable xdebug; \
|
|
||||||
apk del .build-deps
|
|
||||||
|
|
||||||
RUN rm -f .env.local.php
|
RUN rm -f .env.local.php
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user