BM: Baca dalam Bahasa Melayu
World D4: Set Meals
Inside compose.yaml
You will learn: to read every block of a compose.yaml.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Tap the three dishes in this file.
0 of 3 found
Aisyah wrote the shop’s compose.yaml. It looks like a wall of words. Find the three dishes first.
Try it
Build the same file yourself. Add the three dishes. Give db its locker. Watch compose.yaml grow, block by block.
Add web, api and db. Then give db the locker db-data.
Menu (tap or drag)
Your set meal
Empty. Tap a dish on the menu, or drag it here.
compose.yaml 1 lines
services: {}
Hint
Tap each dish on the menu. Then pick db-data in db’s locker list.Check
Each dish has a few keys. Sort them by what they do.
Drag a card into a box. Or tap the card, then tap the box.
Predict
The locker is named twice: on the dish, and at the bottom. What if you delete the bottom block?
db:
image: postgres:18-alpine
volumes:
- db-data:/var/lib/postgresql
volumes:
db-data:Pick one answer.
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.
This file has no networks: block. Compose still made one phone line, kedai-kancil_default. Every dish calls another by its service: One dish in the set meal, like web or db. Compose makes its containers and names them after it. name, like api.
Try it
Dry run first. Ask Compose to print the final file, without starting anything.
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
The command isdocker compose config.You did it!
You can now read every block of a compose.yaml.
Go deeper (optional)
Want two phone lines? List them under a top networks: block, like front and back. Then db can sit on back only. A top line name: kedai sets the project name. compose.yaml is the preferred file name; docker-compose.yml still works.
Real rep (optional): in your hello-set folder, run docker compose config. Compare it with your file.
Bahasa Melayu
Aisyah tulis compose.yaml untuk kedai. Nampak macam dinding perkataan. Cari tiga hidangan dulu.
Bina fail yang sama sendiri. Tambah tiga hidangan. Beri db lokernya. Lihat compose.yaml membesar, blok demi blok.
Setiap hidangan ada beberapa kunci. Susun ikut apa yang ia buat.
Loker disebut dua kali: pada hidangan, dan di bawah sekali. Apa jadi kalau anda padam blok bawah?
db:
image: postgres:18-alpine
volumes:
- db-data:/var/lib/postgresql
volumes:
db-data:
Fail ini tiada blok networks:. Compose tetap buat satu talian telefon, kedai-kancil_default. Setiap hidangan panggil yang lain ikut nama service (hidangan dalam set), contohnya api.
Larian kering dulu. Minta Compose paparkan fail akhir, tanpa hidupkan apa-apa.
docker compose config.Kini anda boleh baca setiap blok dalam compose.yaml.
You finished this before. Practice is always welcome!
Official docs: Compose file reference: services · Compose file reference: volumes · Networking in Compose
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?