BM: Baca dalam Bahasa Melayu
World D4: Set Meals · Boss challenge
One command, whole shop
You will learn: to design, open and close web, API, database and cache with one command.
Checked with Docker Engine 29 on 31 Oct 2026
The problem
Boss! Kedai Kancil opens tomorrow. Web, API, database and cache must start with one command. Room 1: design the set meal.
All four dishes. db keeps db-data. web on front, db and cache on back, api on both. api waits for db and cache to be healthy.
Menu (tap or drag)
Your set meal
Empty. Tap a dish on the menu, or drag it here.
compose.yaml 1 lines
services: {}
Hint
api is the only dish on both phone lines.Predict
Room 2: in what order will Compose start them?
First to start at the top. Put these in order. Use the arrows, or drag.
- api
- web
- db and cache
Try it
Room 3: open the shop with one command. A red line? Read it kindly, fix it, try again.
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
Room 4: the page loads, but orders fail. Which command shows what the API said?
Pick one answer.
Check
Room 5: closing time. Swipe right for a safe way to close. Swipe left for a risky one.
Swipe right for good, left for needs work. Or use the buttons.
docker compose down
Try it
Final room: close for the night. Keep the orders.
Your laptop~/kedai-kancil
- Laptop port 8080 → kedai-kancil-web-1 port 80
Lunchboxes (containers)
- kedai-kancil-cache-1running · healthy
- kedai-kancil-db-1running · healthy
- kedai-kancil-api-1running
- kedai-kancil-web-1running
Frozen packs (images)
- kedai-kancil-api:latest6 layers · 244MB · in use
- kedai-kancil-web:latest9 layers · 92.6MB · in use
- nginx:1.30-alpine8 layers · 93.5MB
- node:24-alpine4 layers · 244MB
- postgres:18-alpine9 layers · 433MB · in use
- redis:8-alpine7 layers · 162MB · in use
Lockers (volumes)
- kedai-kancil_db-data24 files · used by kedai-kancil-db-1
Phone lines (networks)
- kedai-kancil_backkedai-kancil-cache-1 ↔ kedai-kancil-db-1 ↔ kedai-kancil-api-1
- kedai-kancil_frontkedai-kancil-api-1 ↔ kedai-kancil-web-1
4 containers (4 running), 6 images, 1 lockers.
Hint
docker compose down, without -v.You did it!
You can now open and close a whole shop with one command.
Go deeper (optional)
The cache’s health check runs redis-cli ping. Redis answers PONG when it is ready. The back phone line keeps the database away from web: only api can call it. Want to do this on your own machine? That is Mission 1, with your own kedai-kancil repo.
Bahasa Melayu
Boss! Kedai Kancil dibuka esok. Web, API, pangkalan data dan cache mesti hidup dengan satu arahan. Bilik 1: reka set hidangan.
Bilik 2: ikut urutan apa Compose akan hidupkan mereka?
Bilik 3: buka kedai dengan satu arahan. Ada baris merah? Baca dengan tenang, baiki, cuba lagi.
docker compose up -d.Bilik 4: laman keluar, tapi pesanan gagal. Arahan mana tunjuk apa kata API?
Bilik 5: masa tutup kedai. Leret ke kanan untuk cara tutup yang selamat. Leret ke kiri untuk yang berisiko.
Bilik terakhir: tutup untuk malam ini. Simpan pesanan.
docker compose down, tanpa -v.Kini anda boleh buka dan tutup seluruh kedai dengan satu arahan.
You finished this before. Practice is always welcome!
Official docs: Docker Compose overview · Control startup order · Networking in Compose
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?