diff --git a/apache/Dockerfile b/apache/Dockerfile index dd4ad3c..75e53b7 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -25,6 +25,10 @@ RUN --mount=type=cache,target=/var/cache/apt \ unzip \ zlib1g-dev \ libicu-dev \ + libjpeg-dev \ + libpng-dev \ + libwebp-dev \ + libfreetype6-dev \ g++ \ nodejs \ npm \ @@ -56,6 +60,8 @@ RUN a2enmod rewrite RUN docker-php-ext-configure intl +RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp + # Install PHP extensions RUN docker-php-ext-configure \ opcache --enable-opcache @@ -77,6 +83,10 @@ RUN docker-php-ext-enable \ imagick \ opcache +# Fail fast if the JPEG delegate did not make it into the image +RUN php -r 'if (!in_array("JPEG", Imagick::queryFormats())) { fwrite(STDERR, "ERROR: imagick built without JPEG delegate\n"); exit(1); } echo "imagick JPEG delegate OK\n";' && \ + php -r 'if (!function_exists("imagecreatefromjpeg")) { fwrite(STDERR, "ERROR: gd built without JPEG support\n"); exit(1); } echo "gd JPEG OK\n";' + # PHP RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_FILE" && \ sed -i "s|memory_limit = 128M|memory_limit = 256M |g" "$PHP_INI_FILE" && \