add docker files
This commit is contained in:
24
frontend/Dockerfile
Normal file
24
frontend/Dockerfile
Normal 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;"]
|
||||
Reference in New Issue
Block a user