Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning DevOps with Docker

You're reading from   Beginning DevOps with Docker Automate the deployment of your environment with the power of the Docker toolchain

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781789532401
Length 96 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Joseph Muli Joseph Muli
Author Profile Icon Joseph Muli
Joseph Muli
Arrow right icon
View More author details
Toc

The docker-compose Tool

Let's begin the lesson by looking at what a multi-container setup is, why it is important, and how Docker, with the tool docker-compose, works like a charm in such scenarios.

We have recently been introduced to how applications work, with their separate elements: frontend, backend, and database.

To run such a multi-tier application using Docker, one would need to run the following commands to spin up the containers in different terminal sessions:

- docker run <front-end>
- docker run <back-end>
- docker run <database>

Note

You can run docker run with (-d) as detached to prevent us from running the three commands in separate sessions, for example: docker run <front-end> -d

That said, it even becomes particularly tasking linking different containers (networking).

docker-compose comes in to save the day. We can define and run multi-containers from one file - docker-compose.yml. In the following topics, we'll discuss this further. First,...

You have been reading a chapter from
Beginning DevOps with Docker
Published in: May 2018
Publisher: Packt
ISBN-13: 9781789532401
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image