Spaces:
Paused
Paused
# Stage 1: Build the React application | |
FROM node:20-alpine AS builder | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
# Install dependencies | |
COPY frontend/package.json frontend/package-lock.json ./ | |
RUN npm install | |
# Copy source files and build the React application | |
COPY frontend ./ | |
RUN npm run build | |
# Stage 2: Serve the React application using Nginx | |
FROM bitnami/nginx:1.26.1 | |
# Copy custom Nginx configuration | |
COPY nginx.conf /opt/bitnami/nginx/conf/nginx.conf | |
# Copy the React build from the builder stage | |
COPY --from=builder /app/build /usr/share/nginx/html | |
EXPOSE 7860 | |
# Start Nginx | |
CMD ["nginx", "-g", "daemon off;"] | |