Simplify Docker build and pin dependencies for Artifactory compatibility

- Remove npm registry build arguments from Dockerfile
- Use npm install to leverage host machine's npm config
- Pin vite (6.3.6), rollup (4.50.2), and undici-types (7.12.0)
- Remove all .npmrc files from repo (use machine-level config)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
pratik
2025-10-15 15:31:07 -05:00
parent 5e760d84e8
commit 4feb9fe337
5 changed files with 12 additions and 29 deletions

View File

@@ -1,26 +1,18 @@
# Multi-stage build: First stage builds Angular frontend
FROM node:18-alpine as frontend-builder
# Build argument to select npm registry (public or artifactory)
ARG NPM_REGISTRY=public
ARG ARTIFACTORY_AUTH_TOKEN=""
# Install dependencies for native modules
RUN apk add --no-cache python3 make g++
WORKDIR /frontend
# Copy package files and registry configs
# Copy package files
COPY frontend/package*.json ./
COPY frontend/.npmrc.${NPM_REGISTRY} ./.npmrc
# If using artifactory and auth token is provided, configure it
RUN if [ "$NPM_REGISTRY" = "artifactory" ] && [ -n "$ARTIFACTORY_AUTH_TOKEN" ]; then \
echo "Configuring Artifactory authentication..."; \
fi
# Clean install dependencies
RUN npm ci --force
# Install dependencies using npm install
# This will use the Docker build environment's npm configuration (.npmrc)
# and generate a package-lock.json appropriate for the configured registry
RUN npm install --legacy-peer-deps
# Copy frontend source
COPY frontend/src ./src

View File

@@ -1 +0,0 @@
registry=https://registry.npmjs.org/

View File

@@ -1,11 +0,0 @@
# Replace YOUR_ARTIFACTORY_URL with your actual Artifactory URL
registry=https://YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/
# If authentication is required, uncomment and configure:
# //YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/:_auth=${ARTIFACTORY_AUTH_TOKEN}
# //YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/:always-auth=true
# Alternative: username/password (less secure, not recommended)
# //YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/:username=${ARTIFACTORY_USERNAME}
# //YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/:_password=${ARTIFACTORY_PASSWORD}
# //YOUR_ARTIFACTORY_URL/artifactory/api/npm/npm-virtual/:email=your-email@company.com

View File

@@ -1 +0,0 @@
registry=https://registry.npmjs.org/

View File

@@ -30,6 +30,7 @@
"@angular/cli": "^19.2.17",
"@angular/compiler-cli": "^19.2.0",
"@types/jasmine": "~5.1.0",
"@types/node": "22.10.5",
"jasmine-core": "~5.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
@@ -38,14 +39,17 @@
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.7.2",
"vite": "6.3.6",
"rollup": "4.50.2"
"rollup": "4.50.2",
"undici-types": "7.12.0"
},
"resolutions": {
"vite": "6.3.6",
"rollup": "4.50.2"
"rollup": "4.50.2",
"undici-types": "7.12.0"
},
"overrides": {
"vite": "6.3.6",
"rollup": "4.50.2"
"rollup": "4.50.2",
"undici-types": "7.12.0"
}
}