Managing Containers with Docker Compose

Compose is a tool for defining and running multi-container Docker applications.

Docker Compose

From Web development standpoint, Docker compose is definitely one of the more exciting pieces of doctor. It’s a great way to automatically manage the life cycle of your application in the development environment and get it up and running and stop it.
With the docker-compose we can run it through a doctor compose build process. And this build process can actually generate images that we can then use to create containers.

Docker-Compose uses YAML files as inputs for creation of Services. The docker-compose file contain following fields : version, services, networks, etc. The example of docker-compose file:

ports:

- 5000

networks:

- aspnet-network

Once we have doctor-compose yaml file available, we can go into the terminal and run the doctor compose tool. That will automatically build or rebuild all of the different service images that we need that are all defined in our doctor-compose file.

?

1

$ docker-compose build

After creating the image, we can start up the container by just running up command

?

1

$ docker-compose up

And similiarly tear-down the created container with down command:

?

1

$ docker-compose down

For sample code project : Github Repo

--

--

An Azurer, Web developer, Technologist, Writer, Poet, Runner. Opinions are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Milind Chavan

An Azurer, Web developer, Technologist, Writer, Poet, Runner. Opinions are my own.