Module 4 ยท Containers and environments Lesson 11 of 15
docker-compose: the whole stack in one file
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.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
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.