Skip to content

a simple react application to get started with docker and DevOps basics

License

Notifications You must be signed in to change notification settings

nour-karoui/docker-init

Repository files navigation

Welcome to Docker Init 👋

Documentation Maintenance License: MIT

a simple react application to get started with docker and DevOps basics

Install

> git clone https://github.com/nour-karoui/docker-init.git
> cd frontend
// running the project locally
> npm i
> npm start

How It Works

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.


1- Dev Environment

Dockerfile-dev builds an image for developing

Running The project
docker build -t YOUR_DOCKER_ID/docker-react -f Dockerfile-dev .
docker run -p 3000:3000 YOUR_DOCKER_ID/docker-react
Running Tests
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

2- Prod Environment

Dockerfile builds an image for production

docker build -t YOUR_DOCKER_ID/docker-react-prod .
docker run YOUR_DOCKER_ID/docker-react-prod

3- Github & Travis CI

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.


Author

👤 Nour

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a STAR if this project helped you!

📝 License

  • Copyright © 2021 Nour.
  • This project is MIT licensed.

This README was generated with by readme-md-generator

About

a simple react application to get started with docker and DevOps basics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published