Skip to content

Commit c18f123

Browse files
committed
build:add missing PHP extension dependencies
1 parent 0eb0e5f commit c18f123

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

docker/php/Dockerfile.prod

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM php:8.2-fpm-alpine
33
# Set working directory
44
WORKDIR /var/www
55

6-
# Install system dependencies
6+
# Install system dependencies and dev packages
77
RUN apk add --no-cache \
88
git \
99
curl \
@@ -13,16 +13,31 @@ RUN apk add --no-cache \
1313
unzip \
1414
mysql-client \
1515
supervisor \
16-
nginx
16+
nginx \
17+
freetype-dev \
18+
libjpeg-turbo-dev \
19+
libwebp-dev \
20+
zlib-dev \
21+
libxpm-dev \
22+
oniguruma-dev
1723

18-
# Clear cache
19-
RUN rm -rf /var/cache/apk/*
24+
# Configure GD extension
25+
RUN docker-php-ext-configure gd \
26+
--with-freetype \
27+
--with-jpeg \
28+
--with-webp
2029

2130
# Install PHP extensions
2231
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd xml
2332

33+
# Clear cache
34+
RUN rm -rf /var/cache/apk/*
35+
2436
# Install Redis extension
25-
RUN pecl install redis && docker-php-ext-enable redis
37+
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
38+
&& pecl install redis \
39+
&& docker-php-ext-enable redis \
40+
&& apk del .build-deps
2641

2742
# Install Composer
2843
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer

0 commit comments

Comments
 (0)