From 1915fe18c1211d268e86a15a9a00a0e39384866c Mon Sep 17 00:00:00 2001 From: mukeshs Date: Thu, 16 Oct 2025 21:14:49 +0530 Subject: [PATCH] docker update --- fuse-starter-v20.0.0/Dockerfile | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/fuse-starter-v20.0.0/Dockerfile b/fuse-starter-v20.0.0/Dockerfile index 480753b..04c039f 100644 --- a/fuse-starter-v20.0.0/Dockerfile +++ b/fuse-starter-v20.0.0/Dockerfile @@ -1,14 +1,35 @@ -FROM node:16-alpine AS builder +# Stage 1: Build Angular application +FROM node:18-alpine AS builder + WORKDIR /app +# Copy package files COPY package*.json ./ -RUN npm install --legacy-peer-deps --prefer-offline +# Install dependencies +RUN npm ci --legacy-peer-deps + +# Copy source code COPY . . + +# Build the application RUN npm run build -FROM nginx:alpine +# Stage 2: Serve with Nginx +FROM nginx:alpine AS production + +# Copy built artifacts COPY --from=builder /app/dist/fuse-angular /usr/share/nginx/html -RUN echo 'server { listen 80; location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf + +# Nginx config for Angular routing +RUN echo 'server { \ + listen 80; \ + location / { \ + root /usr/share/nginx/html; \ + index index.html; \ + try_files $uri $uri/ /index.html; \ + } \ +}' > /etc/nginx/conf.d/default.conf + EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file