Angepass an Produtionumgebung
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# --- Build-Stage: Statische Dateien mit Vite bauen ---
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# --- Serve-Stage: Auslieferung über nginx ---
|
||||
FROM nginx:alpine
|
||||
|
||||
# Eigene nginx-Konfiguration (statische Auslieferung + /api-Proxy)
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Gebaute Dateien aus der Build-Stage übernehmen
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user