diff --git a/fuse-starter-v20.0.0/Dockerfile b/fuse-starter-v20.0.0/Dockerfile index 3f810de..9673dd5 100644 --- a/fuse-starter-v20.0.0/Dockerfile +++ b/fuse-starter-v20.0.0/Dockerfile @@ -1,21 +1,28 @@ -# Stage 1: Build Angular app -FROM node:18-alpine as build +# Stage 1: Build Angular application +FROM node:18-alpine AS builder + WORKDIR /app -# Install build dependencies -RUN apk add --no-cache python3 make g++ - +# Copy package files COPY package*.json ./ + +# Install dependencies with legacy peer deps flag RUN npm ci --legacy-peer-deps +# Copy source code COPY . . -# Increase Node memory and use faster build -ENV NODE_OPTIONS="--max-old-space-size=4096" +# Build for production RUN npm run build -- --configuration production -# Stage 2: Serve via Nginx -FROM nginx:alpine -COPY --from=build /app/dist /usr/share/nginx/html +# Stage 2: Serve with Nginx +FROM nginx:alpine AS production + +# Copy built artifacts from builder +COPY --from=builder /app/dist/fuse-angular /usr/share/nginx/html + +# Expose port 80 EXPOSE 80 + +# Run nginx CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file