docker update
This commit is contained in:
@ -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;"]
|
||||
Reference in New Issue
Block a user