From c2121e39957b8a83e115f06e33b250f3da203e70 Mon Sep 17 00:00:00 2001 From: Muhammad Ibrahim Date: Tue, 28 Oct 2025 16:41:35 +0000 Subject: [PATCH] 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. --- docker/frontend.Dockerfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/frontend.Dockerfile b/docker/frontend.Dockerfile index 1f668d0..a7b7d28 100644 --- a/docker/frontend.Dockerfile +++ b/docker/frontend.Dockerfile @@ -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