switch between arti and default
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,13 +1,23 @@
|
||||
# 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 first for better layer caching
|
||||
# Copy package files and registry configs
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user