World map

 

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

    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

          Inside web, wget asks for http://api:3000. The api lunchbox answers with the shop's JSON. Docker transcript: $ docker compose up -d [+] up 5/5 ✔ Network kedai-kancil_default Created 0.1s ✔ Volume kedai-kancil_db-data Created 0.0s ✔ Container kedai-kancil-web-1 Started 0.3s ✔ Container kedai-kancil-api-1 Started 0.3s ✔ Container kedai-kancil-db-1 Started 0.3s $ docker compose exec web wget -qO- http://api:3000 {"ok":true,"shop":"Kedai Kancil"}

          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.

          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.