directory structure built
Some checks failed
Build and Deploy Angular App (Artifacts, Gitea-safe) / build (push) Failing after 13s
Build and Deploy Angular App (Artifacts, Gitea-safe) / scan (push) Has been skipped
Build and Deploy Angular App (Artifacts, Gitea-safe) / deploy (push) Has been skipped

This commit is contained in:
m.imanpour
2025-12-10 00:58:05 +03:30
parent 8f6252195d
commit 3d96371492
5 changed files with 130 additions and 0 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# ===== 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
COPY --from=builder /app/dist/niayesh-hospital /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;"]