fix: use Debian node for build stages to fix rollup musl Alpine bug
This commit is contained in:
+5
-4
@@ -1,15 +1,16 @@
|
|||||||
# Stage 1: Build frontend
|
# Stage 1: Build frontend (use Debian-based node to avoid Alpine musl/rollup issues)
|
||||||
FROM node:20-alpine AS frontend-build
|
FROM node:20 AS frontend-build
|
||||||
WORKDIR /app/frontend
|
WORKDIR /app/frontend
|
||||||
|
ENV NODE_ENV=development
|
||||||
COPY frontend/package*.json ./
|
COPY frontend/package*.json ./
|
||||||
# Remove lock file and reinstall fresh to avoid rollup musl bug on Alpine
|
|
||||||
RUN rm -f package-lock.json && npm install --legacy-peer-deps
|
RUN rm -f package-lock.json && npm install --legacy-peer-deps
|
||||||
COPY frontend/ ./
|
COPY frontend/ ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Build backend
|
# Stage 2: Build backend
|
||||||
FROM node:20-alpine AS backend-build
|
FROM node:20 AS backend-build
|
||||||
WORKDIR /app/backend
|
WORKDIR /app/backend
|
||||||
|
ENV NODE_ENV=development
|
||||||
COPY backend/package*.json ./
|
COPY backend/package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY backend/ ./
|
COPY backend/ ./
|
||||||
|
|||||||
Reference in New Issue
Block a user