Files
HIS/Dockerfile
m.imanpour 08c693bede
All checks were successful
Build and Deploy Angular App HIS / build (push) Successful in 43s
Build and Deploy Angular App HIS / deploy (push) Successful in 53s
force redeploy without devsecops v3
2025-12-10 01:24:55 +03:30

33 lines
768 B
Docker

# ===== Stage 1: Build the Angular app =====
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files for caching
COPY package*.json ./
RUN npm ci
# Copy source code
COPY . .
# Build for production
RUN npm run build -- --configuration production
# ===== Stage 2: Serve static files with Nginx (app service) =====
FROM nginx:alpine
# Install curl for healthcheck (nginx:alpine doesn't have wget/curl by default)
RUN apk add --no-cache curl
# Remove default Nginx files
RUN rm -rf /usr/share/nginx/html/*
# Copy built Angular app
COPY --from=builder /app/dist/niayesh-hospital/browser /usr/share/nginx/html
# Copy app-specific Nginx config for SPA routing
COPY nginx_app.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]