FROM node:18 | |
WORKDIR /app | |
# Copy package.json and package-lock.json | |
COPY package*.json ./ | |
# Install dependencies | |
RUN npm install | |
# Copy the rest of the code | |
COPY . . | |
# Build the React app | |
RUN npm run build | |
# Install a simple server to serve the static files | |
RUN npm install -g serve | |
# Expose the port | |
EXPOSE 7860 | |
# Start the server | |
CMD ["serve", "-s", "build", "-l", "7860"] |