O'Reilly logo

Hands-On Microservices with Node.js by Diogo Resende

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Docker Compose

Wouldn't it be great if we could define all the containers we need for our service to work in a simple interface? Welcome to Docker Compose. This is an orchestration tool that enables us to do what we just did in a simpler way and, most importantly, in a distributed way.

We can define how our containers interact with each other and what they need in a simple file structure, and then we can transfer that to another host and just run Docker Compose, where it will deploy it all for us.

Docker Compose uses a YAML file, which is a human-readable data serialization language. It's easier to read and understand and at the same time, allows us to make complex configurations.

Let's migrate our two containers to this layout. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required