From 32d84fa3ff50971a0ad038622181994f2d1a256e Mon Sep 17 00:00:00 2001 From: LatansaBima Date: Thu, 12 Jun 2025 16:56:15 +0700 Subject: [PATCH] fix: adding composer install to fixing error --- Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 826f5f6..40a5430 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,26 +4,24 @@ WORKDIR /app COPY . . +RUN apk add --no-cache nodejs npm + RUN composer install --no-dev --optimize-autoloader RUN npm ci && npm run build FROM php:8.2-fpm +WORKDIR /var/www + +RUN apt-get update && apt-get install -y curl unzip git \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + COPY --from=build /app /var/www -RUN apt-get update && apt-get install -y \ - libzip-dev \ - libpng-dev \ - libjpeg-dev \ - libfreetype6-dev \ - libonig-dev \ - libxml2-dev \ - zip \ - git \ - unzip - +RUN apt update && apt install -y libpng-dev libonig-dev libxml2-dev zip unzip git curl RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd -COPY --from=build /app /var/www +RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache \ + && chmod -R 775 /var/www/storage /var/www/bootstrap/cache CMD ["php-fpm"] \ No newline at end of file