fix Dockerfile
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -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 . .
|
||||
|
||||
Reference in New Issue
Block a user