feat: npm run build dockerfile
This commit is contained in:
parent
85626b2499
commit
02312d35c0
18
Dockerfile
18
Dockerfile
|
|
@ -1,5 +1,5 @@
|
|||
# --- Étape de Build ---
|
||||
FROM composer:2.7 AS build
|
||||
# --- Étape de Build (Composer) ---
|
||||
FROM composer:2.7 AS composer-build
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
|
|
@ -11,6 +11,17 @@ COPY . .
|
|||
|
||||
RUN composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
# --- Étape de Build (Node) ---
|
||||
FROM node:20-alpine AS node-build
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# --- Étape Finale (Production) ---
|
||||
FROM dunglas/frankenphp:1.3-php8.4-alpine
|
||||
|
||||
|
|
@ -33,7 +44,8 @@ RUN install-php-extensions \
|
|||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY --from=build /var/www/html /var/www/html
|
||||
COPY --from=composer-build /var/www/html /var/www/html
|
||||
COPY --from=node-build /var/www/html/public/build /var/www/html/public/build
|
||||
|
||||
# Permissions (crucial pour Laravel)
|
||||
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
|
|
|
|||
Loading…
Reference in New Issue