react test

This commit is contained in:
2025-01-26 00:08:11 +01:00
parent 79c985bada
commit fadca54b3c

View File

@@ -1,11 +1,33 @@
# Dockerfile
# ------------
# Create a production-ready Docker container to host the React app.
# Use an official Node.js runtime as a parent image
FROM node:18 as build
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the app's source code
COPY . .
# Build the app for production
RUN npm run build
# Use a lightweight web server to serve the built app
FROM nginx:alpine
# Kopiere das gesamte 'view' Verzeichnis in das Nginx-HTML-Verzeichnis
COPY view/ /usr/share/nginx/html/
# Copy the build files from the previous stage
COPY --from=build /app/build /usr/share/nginx/html
# Exponiere den Port 80 für den Container
# Expose the port the app runs on
EXPOSE 80
# Standardbefehl zum Starten von Nginx
# Start the Nginx server
CMD ["nginx", "-g", "daemon off;"]