26 lines
553 B
Docker
26 lines
553 B
Docker
# Use a base image with Node.js and npm
|
|
FROM node:18-alpine
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and package-lock.json
|
|
COPY index.html /app
|
|
COPY package.json /app
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy the rest of the React app
|
|
COPY public/images/. /app/images/
|
|
COPY src/. /app/src/
|
|
|
|
# Build the React app for production
|
|
RUN npm run build
|
|
|
|
# Expose the port your React app will run on (usually 3000)
|
|
EXPOSE 3000
|
|
|
|
# Start the production server (serve the built files)
|
|
CMD ["npx", "serve", "dist"]
|