This repo demonstrates how to run a react app in development and production environments. All the changes and tests can be previewed in real-time during the development stage. In this example, the docker container provides a Node.js environment and therefore, there is no need to install Node.js in the local machine.
Run docker-compose up
or docker-compose up --build
to start the react app and execute tests. This docker-compose allows you to preview changes or tests during runtime.
This repo demonstrates how to run a react app in development and production environments. All the changes and tests can be previewed in real-time during the development stage. In this example, the docker container provides a Node.js environment and therefore, there is no need to install Node.js in the local machine.
Run docker-compose up
or docker-compose up --build
to start the react app and execute tests. This docker-compose allows you to preview changes or tests during runtime.
Build the react app first, and move static files to Nginx folder.
$ docker build -t YOUR_DOCKERHUB_ID/react-app:latest -f Dockerfile.prod .
Run the image.
$ docker run -p 3000:80 YOUR_DOCKERHUB_ID/react-app:latest