🏠 Homepage
> git clone https://github.com/nour-karoui/docker-init.git
> cd frontend
// running the project locally
> npm i
> npm start
In this project, we prepared two dockerfiles, to build two docker images, one appropriate for dev env and the other one for prod env
To run this project, make sure you have docker installed and create an account on Dockerhub
PS: You won't need any other dependencies installed, not even nodejs. Since the project on a container.
Dockerfile-dev builds an image for developing
docker build -t YOUR_DOCKER_ID/docker-react -f Dockerfile-dev .
docker run -p 3000:3000 YOUR_DOCKER_ID/docker-react
docker run YOUR_DOCKER_ID/docker-react npm run test
Since building a docker image means taking a snapshot of the current source code, later changes won't be detected in the docker container. We configured the docker compose file so that local changes will be automatically propagated to the docker container.
So instead of
docker run -p 3000:3000 YOUR_DOCKER_ID/docker-react
We simply write
docker-compose up
Dockerfile builds an image for production
docker build -t YOUR_DOCKER_ID/docker-react-prod .
docker run YOUR_DOCKER_ID/docker-react-prod
Each time we push our code to the github repo, Travis CI is triggered to run the build a docker image and run the container to execute the tests and make sure everything works properly.
👤 Nour
- Github: @nour-karoui
- LinkedIn: @nourkaroui
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a STAR if this project helped you!
This README was generated with by readme-md-generator