BM: Baca dalam Bahasa Melayu
World C2: Container Pipelines
Compose in CI
You will learn: to start your whole set meal on the runner with Compose.
Checked with GitHub Actions 2026-10 on 31 Oct 2026
The problem
Your compose.yaml starts web, API and Postgres on your laptop. In CI, do you rewrite it all as services?
Pick one answer.
Watch
Tap each point on the timeline.
Three commands put the Compose: A set meal: start many containers together with one command. set meal on the belt. Tap each one.
Predict
One order test fails. Tap the station that will stop the line, then press Run.
Which station will stop the line? Tap it, then press Run.
Workflow file .github/workflows/test.yml
name: Test on: pull_request: permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: docker compose up -d --wait - run: docker compose run --rm api npm test - if: always() run: docker compose down -v
The line
Pull request · feature → main
Check
The tests failed. Did the last step, docker compose down -v, still run?
Pick one answer.
Try it
Build the command that runs the API tests in a fresh container.
Tap the pieces in the right order.
You did it!
You can now run your whole Compose stack in CI.
Go deeper (optional)
Add a step with if: failure() that runs docker compose logs. Then a red run shows what each container said. GitHub’s runners are wiped after each job anyway. down -v matters most on your own runners.
Real rep (optional), in a public practice repo with a compose.yaml:
Real mission
docker compose up -d --waitdocker compose run --rm api npm test
0 of 3 steps done · Your ticks are saved.
Bahasa Melayu
compose.yaml anda hidupkan web, API dan Postgres di laptop. Dalam CI, perlukah anda tulis semula semuanya sebagai services?
Tiga arahan letak set hidangan Compose di tali sawat. Ketik setiap satu.
Satu ujian pesanan gagal. Ketik stesen yang akan hentikan talian, kemudian tekan Run.
Ujian gagal. Adakah langkah terakhir, docker compose down -v, masih jalan?
Bina arahan yang jalankan ujian API dalam container baru.
Kini anda boleh jalankan seluruh stack Compose anda dalam CI.
You finished this before. Practice is always welcome!
Official docs: docker compose up · docker compose run · Status check functions
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?