World map

 

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.

What happened on GitHub

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

  1. docker compose up -d --wait
  2. docker compose run --rm api npm test

0 of 3 steps done · Your ticks are saved.