react test
All checks were successful
Build and Push Docker Image to Gitea Registry / build-and-push (push) Successful in 55s

This commit is contained in:
2025-01-26 00:11:33 +01:00
parent fbf79c71ac
commit 6a3b5f780b
2 changed files with 11 additions and 14 deletions

View File

@@ -1,11 +1,7 @@
# Dockerfile
# ------------
# Create a production-ready Docker container to host the React app.
# Use an official Node.js runtime as a parent image
# Stage 1: Build React App
FROM node:18 as build
# Set the working directory
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
@@ -14,20 +10,20 @@ COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the app's source code
# Copy the rest of the source code
COPY . .
# Build the app for production
# Build the app
RUN npm run build
# Use a lightweight web server to serve the built app
# Stage 2: Serve the app using Nginx
FROM nginx:alpine
# Copy the build files from the previous stage
# Copy build artifacts to Nginx's web root
COPY --from=build /app/build /usr/share/nginx/html
# Expose the port the app runs on
# Expose port 80
EXPOSE 80
# Start the Nginx server
CMD ["nginx", "-g", "daemon off;"]
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -5,7 +5,8 @@
"dependencies": {
"pocketbase": "^0.13.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "^5.0.1",
"react-router-dom": "^6.14.1"
},
"devDependencies": {