Commit a0e7911a authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix: switch npm ci back to npm install --legacy-peer-deps, add diagnostics

parent b8bd8d3d
...@@ -5,20 +5,27 @@ FROM node:20-alpine AS frontend-build ...@@ -5,20 +5,27 @@ FROM node:20-alpine AS frontend-build
WORKDIR /build/frontend WORKDIR /build/frontend
# Print versions for diagnostic purposes
RUN echo "=== Node/npm versions ===" && node --version && npm --version
# Nuke NODE_ENV — CapRover/Docker can inject production # Nuke NODE_ENV — CapRover/Docker can inject production
# which prevents devDependencies (vite, tailwind) from installing # which prevents devDependencies (vite, tailwind) from installing
ENV NODE_ENV= ENV NODE_ENV=
COPY frontend/package.json frontend/package-lock.json* ./ COPY frontend/package.json frontend/package-lock.json* ./
# Install ALL deps including dev (use ci for reproducible installs) # npm install (not ci) — more forgiving of lockfile quirks
RUN npm ci --include=dev && \ # --legacy-peer-deps avoids peer dep conflicts
echo "=== vite check ===" && \ # --prefer-offline uses cache when available
RUN npm install --legacy-peer-deps 2>&1 && \
echo "=== install done ===" && \
ls node_modules/.bin/vite && \
./node_modules/.bin/vite --version ./node_modules/.bin/vite --version
COPY frontend/ ./ COPY frontend/ ./
RUN NODE_ENV=production ./node_modules/.bin/vite build 2>&1 && \ RUN echo "=== starting vite build ===" && \
NODE_ENV=production ./node_modules/.bin/vite build 2>&1 && \
echo "=== dist ===" && \ echo "=== dist ===" && \
ls -la dist/ ls -la dist/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment