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:
18
Dockerfile
18
Dockerfile
@@ -1,26 +1,18 @@
|
|||||||
# Multi-stage build: First stage builds Angular frontend
|
# Multi-stage build: First stage builds Angular frontend
|
||||||
FROM node:18-alpine as frontend-builder
|
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
|
# Install dependencies for native modules
|
||||||
RUN apk add --no-cache python3 make g++
|
RUN apk add --no-cache python3 make g++
|
||||||
|
|
||||||
WORKDIR /frontend
|
WORKDIR /frontend
|
||||||
|
|
||||||
# Copy package files and registry configs
|
# Copy package files
|
||||||
COPY frontend/package*.json ./
|
COPY frontend/package*.json ./
|
||||||
COPY frontend/.npmrc.${NPM_REGISTRY} ./.npmrc
|
|
||||||
|
|
||||||
# If using artifactory and auth token is provided, configure it
|
# Install dependencies using npm install
|
||||||
RUN if [ "$NPM_REGISTRY" = "artifactory" ] && [ -n "$ARTIFACTORY_AUTH_TOKEN" ]; then \
|
# This will use the Docker build environment's npm configuration (.npmrc)
|
||||||
echo "Configuring Artifactory authentication..."; \
|
# and generate a package-lock.json appropriate for the configured registry
|
||||||
fi
|
RUN npm install --legacy-peer-deps
|
||||||
|
|
||||||
# Clean install dependencies
|
|
||||||
RUN npm ci --force
|
|
||||||
|
|
||||||
# Copy frontend source
|
# Copy frontend source
|
||||||
COPY frontend/src ./src
|
COPY frontend/src ./src
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
registry=https://registry.npmjs.org/
|
|
||||||
@@ -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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
registry=https://registry.npmjs.org/
|
|
||||||
@@ -30,6 +30,7 @@
|
|||||||
"@angular/cli": "^19.2.17",
|
"@angular/cli": "^19.2.17",
|
||||||
"@angular/compiler-cli": "^19.2.0",
|
"@angular/compiler-cli": "^19.2.0",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"@types/node": "22.10.5",
|
||||||
"jasmine-core": "~5.6.0",
|
"jasmine-core": "~5.6.0",
|
||||||
"karma": "~6.4.0",
|
"karma": "~6.4.0",
|
||||||
"karma-chrome-launcher": "~3.2.0",
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
@@ -38,14 +39,17 @@
|
|||||||
"karma-jasmine-html-reporter": "~2.1.0",
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
"typescript": "~5.7.2",
|
"typescript": "~5.7.2",
|
||||||
"vite": "6.3.6",
|
"vite": "6.3.6",
|
||||||
"rollup": "4.50.2"
|
"rollup": "4.50.2",
|
||||||
|
"undici-types": "7.12.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"vite": "6.3.6",
|
"vite": "6.3.6",
|
||||||
"rollup": "4.50.2"
|
"rollup": "4.50.2",
|
||||||
|
"undici-types": "7.12.0"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"vite": "6.3.6",
|
"vite": "6.3.6",
|
||||||
"rollup": "4.50.2"
|
"rollup": "4.50.2",
|
||||||
|
"undici-types": "7.12.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user