Files
HIS/Dockerfile
m.imanpour 6627a97eb2
Some checks failed
Build and Deploy Angular App HIS / build (push) Successful in 43s
Build and Deploy Angular App HIS / deploy (push) Failing after 1m54s
force redeploy without devsecops v2
2025-12-10 01:15:31 +03:30

30 lines
700 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
# Remove default Nginx files
RUN rm -rf /usr/share/nginx/html/*
# Copy built Angular app (updated for Angular 17+ default output)
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;"]