Add imagick PHP extension

This commit is contained in:
Vincent Xeno Rahn 2021-07-02 23:48:46 +02:00
parent 1f0ee3d265
commit b37e08f553

View file

@ -20,11 +20,43 @@ COPY UCQ1Lrae /work/plainkit-main/site/accounts/UCQ1Lrae
FROM php:8-fpm-alpine3.13
EXPOSE 9000
WORKDIR /site
WORKDIR /tmp
ENV IMAGICK_SHA 765649716faf3215b6ffca1b329e6a49aa42b24f
ENV EXT_DEPS \
freetype \
libpng \
libjpeg-turbo \
libwebp \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
libwebp-dev \
libzip-dev \
imagemagick-dev \
libtool
ENV PHPIZE_DEPS \
make \
gcc \
g++ \
zlib-dev \
php8-dev
RUN \
apk update && \
apk add --quiet --no-progress freetype-dev libjpeg-turbo-dev libpng-dev && \
apk add --quiet --no-progress ${EXT_DEPS} && \
apk add --no-cache --virtual .build-deps ${PHPIZE_DEPS} && \
curl -L -o /tmp/imagick.tar.gz https://github.com/Imagick/imagick/archive/${IMAGICK_SHA}.tar.gz && tar --strip-components=1 -xf /tmp/imagick.tar.gz && phpize && ./configure && make && make install && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) gd
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-enable imagick && \
apk add --no-cache --virtual .imagick-runtime-deps imagemagick && \
apk del .build-deps && \
rm -rf /tmp/* /var/cache/apk/*
WORKDIR /site
COPY --from=builder /work/plainkit-main /site