Init
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# Stage 1: Build React App
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Dependencies installieren
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
# App bauen
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Serve with nginx
|
||||
FROM nginx:alpine
|
||||
|
||||
# nginx.conf kopieren
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Built app aus builder stage kopieren
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Port 80 exponieren
|
||||
EXPOSE 80
|
||||
|
||||
# nginx starten
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user