Add project files

This commit is contained in:
Frank Woeckener
2025-03-18 10:42:10 +01:00
parent e429c37f62
commit 3133fdad34
22 changed files with 619 additions and 0 deletions

30
react-project/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# Build-Stage
FROM node:16 AS build
WORKDIR /app
# Abhängigkeiten zuerst kopieren und installieren (für besseres Caching)
COPY package*.json ./
RUN npm install
# Den Rest der Anwendung kopieren
COPY . .
# Build-Zeit-Variable setzen
RUN echo "REACT_APP_BUILD_TIME=$(date)" > .env
# Anwendung bauen
RUN npm run build
# Production-Stage
FROM nginx:alpine
# Build-Output vom build-Stage kopieren
COPY --from=build /app/build /usr/share/nginx/html
# Nginx-Konfiguration (optional)
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]