revert npm changes
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -1,24 +1,18 @@
|
||||
# Multi-stage build: First stage builds Angular frontend
|
||||
FROM node:18-alpine as frontend-builder
|
||||
|
||||
# Install dependencies for native modules
|
||||
RUN apk add --no-cache python3 make g++
|
||||
|
||||
WORKDIR /frontend
|
||||
|
||||
# Copy package files
|
||||
# Copy package files first
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
# Copy .npmrc from frontend directory if it exists (using glob pattern to avoid errors)
|
||||
# This allows different environments to use different npm registries
|
||||
# To use: copy your user-level .npmrc to frontend/.npmrc before building
|
||||
# Unix/Mac: cp ~/.npmrc frontend/.npmrc
|
||||
# Windows: copy %USERPROFILE%\.npmrc frontend\.npmrc
|
||||
COPY frontend/.npmr[c] ./ 2>/dev/null || :
|
||||
# Copy .npmrc if it exists (allows using custom npm registry)
|
||||
# The quickstart scripts will create this from user's .npmrc
|
||||
# Using a conditional copy approach
|
||||
RUN --mount=type=bind,source=frontend,target=/tmp/frontend \
|
||||
if [ -f /tmp/frontend/.npmrc ]; then cp /tmp/frontend/.npmrc ./; fi
|
||||
|
||||
# Install dependencies using npm install
|
||||
# This will use the .npmrc configuration if present and generate a package-lock.json
|
||||
# appropriate for the configured registry (Artifactory or public npm)
|
||||
# Install dependencies inside Docker (ensures correct platform binaries)
|
||||
RUN npm install
|
||||
|
||||
# Copy frontend source
|
||||
|
||||
Reference in New Issue
Block a user