Skip to content

Reorganize devcontainer compose into colocated per-stack folders#8

Merged
justinmerrell merged 1 commit into
mainfrom
refactor/devcontainer-stacks-colocation
Jul 13, 2026
Merged

Reorganize devcontainer compose into colocated per-stack folders#8
justinmerrell merged 1 commit into
mainfrom
refactor/devcontainer-stacks-colocation

Conversation

@justinmerrell

Copy link
Copy Markdown
Contributor

What & why

The devcontainer's local services and tooling were split across two parallel trees — Compose fragments in .devcontainer/compose/ and their config files in .devcontainer/config/ — so understanding one stack meant jumping between folders, and compose/ named the file type rather than what a developer is looking for.

This restructures everything into a single stacks/ folder where each service owns its whole footprint (its compose.yaml plus any config), colocated in one place:

.devcontainer/
  compose.yaml                    orchestrator (include list + network) — unchanged location
  stacks/
    postgres/{compose.yaml, init/}
    redis/compose.yaml
    minio/compose.yaml
    registry/compose.yaml
    azimutt/compose.yaml
    observability/{compose.yaml, config/}
  config/shell/                   left in place (not a stack)

Why this shape (over a services/ vs tooling/ split): colocation makes each stack self-describing and independently runnable; a hard category split adds a fuzzy "which bucket?" tax on every addition, and the optional-vs-default signal it would carry is already expressed by Compose profiles (postgres is always-on; the rest are profile-gated). Naming every fragment compose.yaml is also a standard name that improves Dependabot image detection (the old non-standard names were flagged as friction in dependabot.yml).

Changes

  • Moved all 6 fragments → stacks/<name>/compose.yaml; config/postgres/*stacks/postgres/init/; config/observability/*stacks/observability/config/ (all tracked by git as renames, content preserved).
  • Rewrote bind mounts to stack-relative paths (./init, ./config/...).
  • Updated references: compose.yaml include list, validate.yaml CI grep path, dependabot.yml scan dirs (/.devcontainer/stacks/**), and CONFIGURATION.md.
  • Unchanged (target the root compose.yaml, which didn't move): devcontainer.json, startup.sh, the dc alias, .env auto-discovery. config/shell/ stays put — it's devcontainer shell setup, not a stack.

Verification

  • docker compose -f .devcontainer/compose.yaml --profile observability config resolves all includes; every bind-mount source now resolves into stacks/… (confirmed none point at the old paths).
  • Runtime: recreated postgres and confirmed it serves init SQL from the new ./init mount; DB healthy, data preserved.
  • CI floating-tag grep with the new stacks/ path still reaches all 6 fragments and passes.

🤖 Generated with Claude Code

Replace the flat .devcontainer/compose/ directory (with config split off
into a parallel .devcontainer/config/ tree) with a single stacks/ folder
where each service owns its whole footprint: its compose.yaml plus any
config files, colocated in one place.

  compose/postgres.yaml        -> stacks/postgres/compose.yaml
  config/postgres/*            -> stacks/postgres/init/
  compose/observability.yaml   -> stacks/observability/compose.yaml
  config/observability/*       -> stacks/observability/config/
  compose/{redis,minio,registry,azimutt}.yaml -> stacks/<name>/compose.yaml

Colocation makes each stack self-describing and independently runnable,
and naming every fragment compose.yaml is a standard name that improves
Dependabot image detection. The services-vs-tooling distinction is carried
by Compose profiles (postgres always-on; the rest opt-in), not folders.

Bind mounts rewritten to stack-relative paths (./init, ./config/...).
The root compose.yaml orchestrator stays put so .env auto-discovery,
startup.sh, and the dc alias are unaffected.

Updated references: compose.yaml include list, validate.yaml CI grep path,
dependabot.yml scan dirs (/.devcontainer/stacks/**), and CONFIGURATION.md.

Verified: `docker compose config` resolves all includes and mounts into
stacks/; postgres recreated and confirmed serving init SQL from the new
./init mount; CI floating-tag grep still scans every fragment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justinmerrell justinmerrell merged commit 871540e into main Jul 13, 2026
5 checks passed
@justinmerrell justinmerrell deleted the refactor/devcontainer-stacks-colocation branch July 13, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant