docker update

This commit is contained in:
2025-10-16 19:05:43 +05:30
parent 1dfb72ba09
commit bffda42d91

View File

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