World map

 

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: {}
    

    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.

    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.

    1 / 4

    docker compose down

    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
      from redis:8-alpine kedai-kancil_back
    • kedai-kancil-db-1running · healthy
      from postgres:18-alpine kedai-kancil_back kedai-kancil_db-data → /var/lib/postgresql
    • kedai-kancil-api-1running
      from kedai-kancil-api kedai-kancil_front kedai-kancil_back
    • kedai-kancil-web-1running
      from kedai-kancil-web 8080→80 kedai-kancil_front

    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.

    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.