Skip to content

Commit 20cef92

Browse files
committed
Trigger Pipeline
1 parent 691bf69 commit 20cef92

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
docker-compose*.yml
4+
*.log
5+
.git

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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;"]

0 commit comments

Comments
 (0)