mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2026-01-06 04:59:35 -06:00
fix: Build only frontend workspace, not root monorepo dependencies
The previous approach installed workspace root dependencies which included backend packages like 'canvas' that require native build tools (Python, gcc). Changes: - Work directly in /app/frontend instead of /app root - Copy only frontend/package*.json (not root package.json) - Run 'npm run build' instead of 'npm run build:frontend' - This installs only frontend dependencies (Vite, React, etc.) This avoids attempting to build unnecessary backend dependencies in the frontend Docker image.
This commit is contained in:
@@ -17,18 +17,17 @@ CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "3000"]
|
||||
# Builder stage for production
|
||||
FROM node:lts-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY package*.json ./
|
||||
COPY frontend/package*.json ./frontend/
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
RUN npm cache clean --force &&\
|
||||
rm -rf node_modules ~/.npm /root/.npm &&\
|
||||
npm ci --legacy-peer-deps --no-audit --prefer-online --fetch-retries=0
|
||||
|
||||
COPY frontend/ ./frontend/
|
||||
COPY frontend/ ./
|
||||
|
||||
RUN npm run build:frontend
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginxinc/nginx-unprivileged:alpine
|
||||
|
||||
Reference in New Issue
Block a user