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