Copy vendor into node stage for Flux CSS
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 35s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 35s
This commit is contained in:
parent
7cf2ece6e6
commit
e4fc5978f8
1 changed files with 10 additions and 9 deletions
19
Dockerfile
19
Dockerfile
|
|
@ -1,14 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
# Stage 1: Build frontend assets
|
# Stage 1: Install PHP dependencies
|
||||||
FROM node:20-alpine AS node-builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package.json package-lock.json ./
|
|
||||||
RUN npm ci
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage 2: Install PHP dependencies
|
|
||||||
FROM composer:2 AS composer-builder
|
FROM composer:2 AS composer-builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY composer.json composer.lock ./
|
COPY composer.json composer.lock ./
|
||||||
|
|
@ -27,6 +19,15 @@ COPY . .
|
||||||
# Run post-install scripts now that source is present
|
# Run post-install scripts now that source is present
|
||||||
RUN composer run-script post-autoload-dump 2>/dev/null || true
|
RUN composer run-script post-autoload-dump 2>/dev/null || true
|
||||||
|
|
||||||
|
# Stage 2: Build frontend assets (needs vendor for flux CSS)
|
||||||
|
FROM node:20-alpine AS node-builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
COPY . .
|
||||||
|
COPY --from=composer-builder /app/vendor ./vendor
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 3: Production image
|
# Stage 3: Production image
|
||||||
FROM php:8.2-fpm-alpine
|
FROM php:8.2-fpm-alpine
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue