secruity usw
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -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;"]
|
||||
Reference in New Issue
Block a user