fix Dockerfile
Some checks failed
Build, Push and Deploy / build-and-deploy (push) Failing after 2m6s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s

This commit is contained in:
eko
2026-03-16 06:45:23 +07:00
parent 3f5cdcc558
commit f537c75c90

View File

@@ -1,21 +1,35 @@
FROM php:8.2-fpm-alpine
# Install dependencies
# Install system dependencies and PHP extensions
RUN apk add --no-cache \
libzip-dev \
postgresql-dev \
git \
curl \
# Add these for common Laravel extensions
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
oniguruma-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
pdo_pgsql \
pgsql \
opcache \
zip \
bcmath \
gd \
exif \
pcntl \
mysqli \
pdo_mysql \
&& docker-php-ext-enable \
pdo_pgsql \
pgsql \
opcache \
zip
zip \
bcmath \
gd
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
@@ -25,8 +39,9 @@ WORKDIR /var/www/html
# Copy composer files first (for better caching)
COPY composer.json composer.lock ./
# Install dependencies
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader
# Install dependencies with platform requirements ignored (temporary fix)
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader || \
composer install --no-dev --no-interaction --no-progress --optimize-autoloader --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-gd --ignore-platform-req=ext-exif --ignore-platform-req=ext-pcntl
# Copy application files
COPY --chown=www-data:www-data . .