All checks were successful
Build and Push Docker Image to Gitea Registry / build-and-push (push) Successful in 55s
30 lines
501 B
Plaintext
30 lines
501 B
Plaintext
# Stage 1: Build React App
|
|
FROM node:18 as build
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy the rest of the source code
|
|
COPY . .
|
|
|
|
# Build the app
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve the app using Nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy build artifacts to Nginx's web root
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Start Nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|