Add NPM_REGISTRY build arg support in Dockerfile
- Accept NPM_REGISTRY ARG in frontend build stage - Configure npm registry before install if provided - Add build-arg to MR build stage in CI
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
# Frontend build stage
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
|
||||
ARG NPM_REGISTRY
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
# Configure npm registry if provided
|
||||
RUN if [ -n "$NPM_REGISTRY" ]; then npm config set registry "$NPM_REGISTRY"; fi
|
||||
|
||||
# Copy package files
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install
|
||||
|
||||
Reference in New Issue
Block a user