Update file Dockerfile
This commit is contained in:
parent
6c2d1ea395
commit
1af0046490
18
Dockerfile
18
Dockerfile
@ -5,7 +5,7 @@ FROM dunglas/frankenphp:1-php8.3 AS composer
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install PHP extensions DULU
|
||||
# PHP extensions
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpng-dev libjpeg-dev libfreetype6-dev \
|
||||
libzip-dev libicu-dev pkg-config \
|
||||
@ -13,10 +13,19 @@ RUN apt-get update && apt-get install -y \
|
||||
&& docker-php-ext-install gd zip intl exif \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Composer
|
||||
# Composer binary
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# ⬇️ PENTING: copy file inti Laravel dulu
|
||||
COPY artisan artisan
|
||||
COPY bootstrap bootstrap
|
||||
COPY config config
|
||||
COPY app app
|
||||
COPY routes routes
|
||||
COPY database database
|
||||
|
||||
COPY composer.json composer.lock ./
|
||||
|
||||
RUN composer install --no-dev --optimize-autoloader --no-interaction
|
||||
|
||||
|
||||
@ -64,4 +73,7 @@ COPY . .
|
||||
COPY --from=composer /app/vendor vendor
|
||||
COPY --from=frontend /app/public/build public/build
|
||||
|
||||
RUN php artisan optimize:clear
|
||||
RUN chown -R www-data:www-data storage bootstrap/cache \
|
||||
&& chmod -R 775 storage bootstrap/cache
|
||||
|
||||
RUN php artisan optimize:clear || true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user