24 lines
491 B
Docker
24 lines
491 B
Docker
# --- 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;"]
|