secruity usw

This commit is contained in:
2026-04-09 10:34:47 +02:00
parent c7491f9af5
commit 792f9bb2a6
5 changed files with 262 additions and 207 deletions

View File

@@ -1,29 +1,24 @@
# 1. Build-Stage
FROM node:18-alpine AS build
# Build Stage
FROM node:22-alpine AS build
WORKDIR /app
# package files kopieren
COPY package*.json ./
# dependencies installieren
RUN npm install
# restlichen Code kopieren
COPY . .
# React App bauen
# wichtig für API URL
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
RUN npm run build
# 2. Serve-Stage (Nginx)
# Serve Stage
FROM nginx:alpine
# build output in nginx kopieren
COPY --from=build /app/build /usr/share/nginx/html
COPY --from=build /app/dist /usr/share/nginx/html
# optional: eigene nginx config
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 5173
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]