Files
Linktree/dockerfile
jafreli 6a3b5f780b
All checks were successful
Build and Push Docker Image to Gitea Registry / build-and-push (push) Successful in 55s
react test
2025-01-26 00:11:33 +01:00

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;"]