add docker files

This commit is contained in:
Marcus Almert
2025-10-28 12:18:48 +01:00
parent d793462ace
commit dbf54f59ef
6 changed files with 74 additions and 4 deletions

24
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# --- Build Stage ---
FROM node:20 AS build
WORKDIR /app
# 1. Nur package.json zuerst kopieren → Cache für Dependencies
COPY package*.json ./
# 2. Abhängigkeiten installieren
RUN npm ci
# 3. Restlichen Code kopieren
COPY . .
# 4. Sicherstellen, dass vite ausführbar ist (Windows-Berechtigungsfix)
RUN chmod +x node_modules/.bin/vite
# 5. Frontend bauen
RUN npm run build
# --- Serve Stage ---
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]