react test
All checks were successful
Build and Push Docker Image to Gitea Registry / build-and-push (push) Successful in 55s
All checks were successful
Build and Push Docker Image to Gitea Registry / build-and-push (push) Successful in 55s
This commit is contained in:
20
dockerfile
20
dockerfile
@@ -1,11 +1,7 @@
|
|||||||
# Dockerfile
|
# Stage 1: Build React App
|
||||||
# ------------
|
|
||||||
# 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
|
FROM node:18 as build
|
||||||
|
|
||||||
# Set the working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package.json and package-lock.json
|
# Copy package.json and package-lock.json
|
||||||
@@ -14,20 +10,20 @@ COPY package*.json ./
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy the app's source code
|
# Copy the rest of the source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the app for production
|
# Build the app
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Use a lightweight web server to serve the built app
|
# Stage 2: Serve the app using Nginx
|
||||||
FROM nginx:alpine
|
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
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
|
|
||||||
# Expose the port the app runs on
|
# Expose port 80
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Start the Nginx server
|
# Start Nginx
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"pocketbase": "^0.13.0",
|
"pocketbase": "^0.13.0",
|
||||||
"react": "^18.2.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"
|
"react-router-dom": "^6.14.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user