File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ node_modules
2+ dist
3+ docker-compose * .yml
4+ * .log
5+ .git
Original file line number Diff line number Diff line change 1+ # -------------------------------------------------
2+ # 1) Build-Stage
3+ # -------------------------------------------------
4+ FROM node:22.16.0-alpine AS builder
5+
6+ # Arbeitsverzeichnis im Container
7+ WORKDIR /app
8+
9+ # Nur package.json und lockfile kopieren, um Layer-Caching zu ermöglichen
10+ COPY package*.json ./
11+
12+ # Abhängigkeiten installieren
13+ RUN npm ci --legacy-peer-deps
14+
15+ # Rest des Quellcodes kopieren
16+ COPY . .
17+
18+ # Angular CLI lokal installieren (falls nicht in devDependencies)
19+ RUN npm install @angular/cli@latest --no-save
20+
21+ # Anwendung bauen
22+ RUN npx ng build --configuration=production
23+
24+ # -------------------------------------------------
25+ # 2) Production-Stage
26+ # -------------------------------------------------
27+ FROM nginx:1.25-alpine AS production
28+
29+ # Entferne standardmäßiges nginx HTML
30+ RUN rm -rf /usr/share/nginx/html/*
31+
32+ # Kopiere die gebauten Dateien aus dem Builder
33+ COPY --from=builder /app/dist/angular-demo-application /usr/share/nginx/html
34+
35+ # Exponiere Port
36+ EXPOSE 80
37+
38+ # Default-Command
39+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments