Docker Compose
Learn about the benefits of Docker and Docker Compose.
Benefits of Docker
Before learning more about Docker’s features, let’s discuss the benefits of Docker first.
- Docker makes deployment of our application a lot easier by packing the software and its dependencies in a container.
- We need to build our application only once, without needing to build or configure it on multiple environments.
- Once we upload our image in Docker Hub, a public registry to store docker images, we can pull the image in any environment. Our application will work fine because we’re running them in identical containers.
- Docker allows us to do image versioning.
- Docker containers work in isolated environments. They do not interfere with other containers running on the same system.
When an application is built, multiple aspects are taken into consideration. Let’s suppose that we build a shopping website. We have to take care of multiple things, which we can do by using microservices. The entire application is divided into various segments with microservices that are managed separately. In the end, they are connected to work together.
In the case of the shopping website, we have the following requirements:
- Product catalog: This is the list of products available, along with their price, description, and other details.
- Cart server: This maintains the details of the product added to the cart.
- User database server: This is used to maintain user information, such as name and address.
- Payment server: This is used to update the payment details. There can be more such segments. We are considering only four here.
Get hands-on with 1200+ tech skills courses.