Added configurable npm registry support to enable use of custom npm proxies or private registries during Docker builds. This is essential for corporate environments, air-gapped deployments, or when using npm mirrors. **Changes:** - Dockerfile.frontend: Added NPM_REGISTRY build argument with conditional configuration - docker-compose.yml: Pass NPM_REGISTRY from environment to build args - .env.example: Added NPM_REGISTRY configuration with usage examples **Usage:** Set NPM_REGISTRY in .env file or as environment variable: - Nexus: http://nexus.company.com:8081/repository/npm-proxy/ - Artifactory: https://artifactory.company.com/artifactory/api/npm/npm-remote/ - Verdaccio: http://localhost:4873/ - Default: Leave blank for https://registry.npmjs.org/ **Example:** ```bash NPM_REGISTRY=http://your-npm-proxy:8081/repository/npm-proxy/ ./quickstart.sh ``` Defaults to official npm registry if not specified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
38 lines
808 B
Docker
38 lines
808 B
Docker
# Multi-stage build for Angular frontend
|
|
FROM node:24-alpine AS build
|
|
|
|
# Accept npm registry as build argument
|
|
ARG NPM_REGISTRY=https://registry.npmjs.org/
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY frontend/package*.json ./
|
|
|
|
# Configure npm registry if custom one is provided
|
|
RUN if [ "$NPM_REGISTRY" != "https://registry.npmjs.org/" ]; then \
|
|
npm config set registry "$NPM_REGISTRY"; \
|
|
fi
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY frontend/ ./
|
|
|
|
# Build for production
|
|
RUN npm run build:prod
|
|
|
|
# Final stage - nginx to serve static files
|
|
FROM nginx:alpine
|
|
|
|
# Copy built Angular app to nginx
|
|
COPY --from=build /app/dist/frontend/browser /usr/share/nginx/html
|
|
|
|
# Copy nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|