Docker Compose Part 1 — Development environment for Multi-Container Applications

Bhargav Bachina
Bachina Labs
Published in
4 min readFeb 22, 2019

--

we can create a container and run it anywhere with Dockerfile. if we want to run multiple services in separate ports, we could still do it running it with two Dockefiles in multiple terminals.

But what if we want to define a configuration file which has all the details about containers, start the containers with one command and uses this config file anywhere we want. The answer is docker-compose.

docker-compose

Docker compose is a tool which is used for multi-container applications in a single host. As we can see in the following figure, we can run multi containers as services in the single host with the help of docker-compose.yaml.

In this article, we can see the following sections

  1. Beginners’ guide
  2. docker-compose with a single container
  3. docker-compose with multi containers

Beginners’ guide

As mentioned earlier, docker-compose is a tool which runs multi-container applications as services. once we install docker-compose, basically we need to follow these three steps

  • define Dockerfile for the service/container
  • define docker-compose.yaml…

--

--