-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (17 loc) · 766 Bytes
/
Dockerfile
File metadata and controls
27 lines (17 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM node:lts-bookworm-slim AS build-stage
# Set build args (Angular-Konfiguration: production|staging|...).
ARG ENV=production
WORKDIR /app
COPY package*.json .npmrc ./
RUN npm ci
# Angular CLI (falls nicht im devDependencies)
RUN npx -y @angular/cli@latest ng version >/dev/null 2>&1 || true
COPY . .
RUN npm run build -- --configuration=${ENV} --output-path=dist/app
# -----------------------------------------------------------------------
FROM nginx:stable-alpine AS production-stage
RUN rm -rf /usr/share/nginx/html/*
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=build-stage /app/dist/app/browser /usr/share/nginx/html/
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -qO- http://127.0.0.1/healthz || exit 1