Untitled Document
Untitled Document
applications. By using Compose, we can define the services in a YAML file, as well as
spin them up and tear them down with one single command.
Each of these can be considered a microservice. The more microservices you build into
your environment, the more valuable it is to have each of these services in their
containers. But as a developer, you should be able to jump from one container to
another. This is where you can relate this example to Docker, where Docker Compose
can connect different containers as a single service.
Docker Compose is used for running multiple containers as a single service. Each of the
containers here run in isolation but can interact with each other when required. Docker
Compose files are very easy to write in a scripting language called YAML, which is an
XML-based language that stands for Yet Another Markup Language. Another great thing
about Docker Compose is that users can activate all the services (containers) using a
single command.
For example:
If you have an application that requires an NGINX server and Redis database, you can
create a Docker Compose file that can run both the containers as a service without the
need to start each one separately.