๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Cloud, Linux & DevOps Basics Module 4 ยท Lesson 11 of 15

0% Exit to course

Module 4 ยท Containers and environments Lesson 11 of 15

docker-compose: the whole stack in one file

Learning objective

Compose starts several containers together - app, database, cache - and wires them to each other by name. One command brings a developer from nothing to a running stack.

Worked example

In the compose file the app reaches the database at the hostname db, because Compose puts every service on the same network with its service name as the address.

Your practice task

Write a compose file with your app and a database, and start both with docker compose up.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

Compose starts several containers together - app, database, cache - and wires them to each other by name. One command brings a developer from nothing to a running stack.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.