19 lines
492 B
Docker
19 lines
492 B
Docker
# Use a lightweight Nginx image to serve the React app
|
|
FROM nginx:alpine
|
|
|
|
# Set working directory to nginx's default static file directory
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
# Remove default Nginx static assets
|
|
RUN rm -rf ./*
|
|
|
|
# Copy the built React app from the builder stage
|
|
# The React app is built using `npm run build` which creates a `dist` directory
|
|
COPY ./dist .
|
|
|
|
# Expose port 80
|
|
EXPOSE 80
|
|
|
|
# Command to start Nginx (default command of the base image)
|
|
CMD ["nginx", "-g", "daemon off;"]
|