BM: Baca dalam Bahasa Melayu
World D4: Set Meals
Why a set meal?
You will learn: why one file can start your whole app.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Your laptop~/kedai-kancil
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- kedai-api:latest6 layers · 244MB
- kedai-web:latest9 layers · 92.6MB
- nginx:1.30-alpine8 layers · 93.5MB
- node:24-alpine4 layers · 244MB
- postgres:18-alpine9 layers · 433MB
- redis:8-alpine7 layers · 162MB
0 containers (0 running), 6 images, 0 lockers.
Opening Kedai Kancil by hand takes four long commands. Every morning. In this order. Miss one flag, and the shop stays shut.
Watch
Read the file it wrote. Then press Order the set meal.
Menu (tap or drag)
Your set meal
- web
build: ./web - api
build: ./api - db
postgres:18-alpine
compose.yaml 17 lines
services: web: build: ./web ports: - "8080:80" api: build: ./api environment: DB_HOST: db db: image: postgres:18-alpine environment: POSTGRES_PASSWORD: example volumes: - db-data:/var/lib/postgresql volumes: db-data: {}
A set meal is ordered in one go. Compose: A set meal: start many containers together with one command. does that for containers. One file lists every dish. One order starts them all.
Watch
Your laptop~/kedai-kancil
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- kedai-kancil-api:latest6 layers · 244MB
- kedai-kancil-web:latest9 layers · 92.6MB
- nginx:1.30-alpine8 layers · 93.5MB
- node:24-alpine4 layers · 244MB
- postgres:18-alpine9 layers · 433MB
- redis:8-alpine7 layers · 162MB
0 containers (0 running), 6 images, 0 lockers.
That is the real thing. docker compose up -d reads compose.yaml and starts every dish in the background.
Try it
Your turn. Start the whole shop with one command. Then knock on hatch 8080 with curl localhost:8080.
Your laptop~/kedai-kancil
- No open hatches
Lunchboxes (containers)
- No containers yet
Frozen packs (images)
- kedai-kancil-api:latest6 layers · 244MB
- kedai-kancil-web:latest9 layers · 92.6MB
- nginx:1.30-alpine8 layers · 93.5MB
- node:24-alpine4 layers · 244MB
- postgres:18-alpine9 layers · 433MB
- redis:8-alpine7 layers · 162MB
0 containers (0 running), 6 images, 0 lockers.
Hint
Start withdocker compose up -d.Check
Which tool fits each job?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now start a whole stack with one command.
Go deeper (optional)
docker compose is a plugin for the docker command. It looks for compose.yaml in your folder. The folder name becomes the project name. That is why the boxes are called kedai-kancil-web-1.
Real rep (optional), on your own machine:
Real mission
mkdir hello-set && cd hello-setprintf 'services:\n web:\n image: nginx:1.30-alpine\n ports:\n - "8080:80"\n' > compose.yamldocker compose up -ddocker compose down
0 of 5 steps done · Your ticks are saved.
Bahasa Melayu
Buka Kedai Kancil secara manual perlukan empat arahan panjang. Setiap pagi. Ikut urutan ini. Tertinggal satu pilihan, kedai tak dibuka.
Set hidangan dipesan sekali gus. Compose (set hidangan) buat begitu untuk container. Satu fail senaraikan setiap hidangan. Satu pesanan hidupkan semuanya.
Inilah yang sebenar. docker compose up -d baca compose.yaml dan hidupkan setiap hidangan di latar belakang.
Giliran anda. Hidupkan seluruh kedai dengan satu arahan. Kemudian ketuk tingkap 8080 dengan curl localhost:8080.
docker compose up -d.Alat mana sesuai untuk setiap kerja?
Kini anda boleh hidupkan seluruh stack dengan satu arahan.
You finished this before. Practice is always welcome!
Official docs: Docker Compose overview · How Compose works · docker compose up
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?