Sign inSign up

bankerneel/react-sample-docker-app

By bankerneel

•Updated over 4 years ago

A Sample React.js Application Boilerplate with Docker created using create-react-app.

Image
Web servers
0

273

bankerneel/react-sample-docker-app repository overview

⁠A Sample React App using Docker

A Sample React.js⁠ Application Boilerplate with Docker⁠ created using create-react-app⁠.


⁠Pre-Requirements for the project

For development, you will need Docker, Node.js, a node global package like npm, pnpm or yarn, installed in your environment.

⁠Requirements Installations

⁠Docker
⁠Node Installation

Just go on official Node.js website⁠ and download the installer. Also, be sure to have git available in your PATH, npm might need it (You can find git here⁠).

If the installation was successful, you should be able to run the following command.

$ node --version
v14.18.1

$ npm --version
6.14.15

$ pnpm --version
7.5.1

$ yarn --version
1.22.10

If you need to update npm, you can make it using npm! Cool right? After running the following command, just open again the command line and be happy.

$ npm install npm -g

(back to top⁠)


⁠Installing the project dependencies

$ git clone https://github.com/bankerneel/react-sample-docker-app
$ cd react-sample-docker-app
⁠With NPM
$ npm install
⁠With PNPM
$ pnpm install
⁠With YARN
$ yarn install
⁠Running the project in dev-mode
$ npm start
⁠Simple build for production
$ npm run buld
$ npm install -g serve
$ serve -s build

(back to top⁠)

⁠Creating Docker build

⁠Dev Mode
$ docker build -f Dockerfile.dev -t $CONTAINER_NAME .
⁠Production Mode

⁠

$ docker build -f Dockerfile.prod -t $CONTAINER_NAME .

⁠Running the Docker image

⁠Dev Mode
$ docker run -p 3000:3000 $CONTAINER_NAME
⁠Production Mode
$   docker run -p 80:80 -d $CONTAINER_NAME

(back to top⁠)

⁠Docker build using docker-compose⁠

⁠Dev Mode
$ docker-compose -f docker-compose.dev.yaml up -d --build
⁠Production Mode
$ docker-compose -f docker-compose.prod.yaml up -d --build

⁠

⁠Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top⁠)


Tag summary

Content type

Image

Digest

Size

443.8 MB

Last updated

over 4 years ago

docker pull bankerneel/react-sample-docker-app