build: use mlocati/php-extension-installer to speed up docker builds
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
idevakk
2026-03-09 23:29:31 +05:30
parent 371be069db
commit 1e4edb6de2

View File

@@ -23,36 +23,29 @@ RUN npm run build
FROM php:8.4-fpm-alpine
WORKDIR /var/www/html
# Install mlocati/php-extension-installer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install system dependencies
RUN apk add --no-cache \
nginx \
supervisor \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
icu-dev \
git \
$PHPIZE_DEPS \
linux-headers \
openssl-dev
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
pdo_mysql \
gd \
zip \
intl \
bcmath \
pcntl \
opcache \
sockets
# Install PECL extensions (MongoDB and Redis)
RUN pecl install mongodb redis \
&& docker-php-ext-enable mongodb redis \
&& rm -rf /tmp/pear
RUN install-php-extensions \
pdo_mysql \
gd \
zip \
intl \
bcmath \
pcntl \
opcache \
sockets \
mongodb \
redis
# Copy source code and vendor dependencies
COPY . .