add imagemagick to the dockerfile

This commit is contained in:
Codex Agent
2025-11-15 15:12:07 +01:00
parent 7f1ca187e5
commit c7c5089726

View File

@@ -24,6 +24,23 @@ FROM composer:2 AS vendor
WORKDIR /var/www/html WORKDIR /var/www/html
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
# Enable required PHP extensions for Composer (intl, pcntl, gd)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libicu-dev \
libjpeg62-turbo-dev \
libpng-dev \
libfreetype6-dev \
libimagickwand-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
intl \
pcntl \
gd \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only, skip scripts (they run at runtime) # Install production dependencies only, skip scripts (they run at runtime)
RUN composer install \ RUN composer install \
@@ -59,6 +76,7 @@ RUN apt-get update \
libonig-dev \ libonig-dev \
libicu-dev \ libicu-dev \
libxml2-dev \ libxml2-dev \
libimagickwand \
unzip \ unzip \
nano \ nano \
rsync \ rsync \
@@ -73,7 +91,8 @@ RUN apt-get update \
pdo_mysql \ pdo_mysql \
zip \ zip \
&& pecl install redis \ && pecl install redis \
&& docker-php-ext-enable redis \ && pecl install imagemagick \
&& docker-php-ext-enable redis imagemagick \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*