Skip to content

Author + e2e-test canonical arena compose.yaml (Docker 4 slides dependency) #1

Description

@opariffazman

Why

The Docker 4 bootcamp session (9 Jul 2026, slides-devops-bootcampoutlines/2026/docker4.md) teaches Docker Compose by reusing this arena as the subject: learners collapse the Docker 3 manual docker network create + three flag-heavy docker runs into one compose.yamldocker compose up. That's the whole payoff of the session.

The slides author the compose block content verbatim from this repo (same rule as the pinned docker run block in CLAUDE.md). So the canonical compose.yaml must live here, be part of the pinned contract, and be e2e-proven before the deck is authored — otherwise the in-class build is unverified.

This repo currently has no compose.yaml — the "Remaining" list in CLAUDE.md even notes compose is Docker 4's job. This issue is that job.

Task

  1. Add compose.yaml (Compose v2 spec — file named compose.yaml, no version: key) that reproduces the pinned local arena from CLAUDE.md. Target shape (keep it minimal + beginner-legible — only the keys the slides teach):

    services:
      profile:
        image: redis
        volumes:
          - me:/data
      server:
        image: ghcr.io/infratify/arena-server
      avatar:
        image: ghcr.io/infratify/arena-avatar
        ports:
          - "8080:8080"
        environment:
          COLOR: cyan
          SERVER: server:3000
        depends_on:
          - profile
          - server
    volumes:
      me:
    • Do NOT declare an explicit networks: block. Compose auto-creates a project network and services resolve each other by service name (server:3000, redis host profile). That elimination is the teaching payoff — keep it automatic.
    • Only the taught keys: image, ports, environment, volumes, depends_on + top-level volumes:. No build:, restart:, extra networks, etc.
  2. CRITICAL — resolve the startup race. depends_on waits for the profile/server containers to start, not to be ready. Verify the avatar does not fail when redis isn't yet accepting connections on docker compose up:

    • If the avatar's redis client already retries → depends_on alone is fine, document that.
    • If it races/fails → add the minimal fix (a healthcheck on profile + depends_on: { profile: { condition: service_healthy } }, or app-side retry). Prefer whatever keeps the slide YAML simplest; a healthcheck is acceptable and the slides mention it as one-line "production pattern" awareness.
  3. e2e test. Extend scripts/e2e.sh (or add scripts/e2e-compose.sh) to prove, via compose:

    • docker compose up -d brings up all three; avatar reaches server + profile by name.
    • localhost:8080 serves the avatar client; a join shows on the server roster.
    • Volume survives docker compose downup (character/name persists in volume me — the redis SAVE-on-write path from CLAUDE.md).
  4. Pin it to the contract. Add the compose.yaml to the pinned student-facing contract block in CLAUDE.md (the section the slides copy verbatim) and note the breakout override: to join the shared class arena, learners change environment: SERVER: "<instructor-ip>:3000" (external host → IP + port, the reused -p concept) + a team COLOR. Keep the contract stable (renames = breaking changes for the slides).

Acceptance

  • compose.yaml present, Compose v2, no explicit network, minimal taught keys only
  • docker compose up -d reliably brings up the full arena (startup race resolved + documented)
  • e2e script proves by-name resolution, client at :8080, and volume survival across down/up
  • compose.yaml added to the pinned contract in CLAUDE.md + breakout SERVER override documented
  • GHCR images already public (existing Docker 3 dep — just confirm)

Context / cross-refs

  • Pinned docker run contract + single-host truth + redis SAVE note: this repo's CLAUDE.md.
  • Docker 4 outline (how the slides use this): slides-devops-bootcampoutlines/2026/docker4.md (LO1 shows each service/key as a labeled block mapped to its Docker 3 flag; LO2 arranges the blocks in-class; breakout deploys the whole arena to the learner's own EC2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions