File size: 509 Bytes
da83632 77edea3 da83632 77edea3 d91f619 edbc8a0 da83632 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Stage 1: Build the React application
FROM node:18-alpine as builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve the application with Nginx
FROM nginx:alpine
# Copy the built React app from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy the custom Nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf
# EXPOSE port 7860 to match Hugging Face Spaces' expectation
EXPOSE 7860
CMD ["nginx", "-g", "daemon off;"]
|