Some checks failed
Build and Push Docker Image to Gitea Registry / build-and-push (push) Failing after 5s
33 lines
583 B
Plaintext
33 lines
583 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 custom Nginx configuration
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# 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;"]
|