How to deploy react js app on dockhive
1. Prepare Your React App
2. Create a Dockerfile
# Use an official Node.js runtime as a parent image
FROM node:14
# Set the working directory to /app
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install app dependencies
RUN npm install
# Copy the current directory contents into the container at /app
COPY . .
# Build the React app for production
RUN npm run build
# Install serve to run the production build
RUN npm install -g serve
# Expose port 3000 to the outside world
EXPOSE 3000
# Run serve to serve the React app
CMD ["serve", "-s", "build"]3. Create a Proposal File
4. Connect GitHub Account to DockHive
5. Push Changes to GitHub
6. Deployment Process
7. Access Your Deployed App
Conclusion
Last updated