Skip to content

Add dev container configuration for local dev, Codespaces, and Claude Code - #1739

Open
abkfenris wants to merge 1 commit into
mainfrom
claude/devcontainer-setup-bvrqpg
Open

Add dev container configuration for local dev, Codespaces, and Claude Code#1739
abkfenris wants to merge 1 commit into
mainfrom
claude/devcontainer-setup-bvrqpg

Conversation

@abkfenris

Copy link
Copy Markdown
Member

Introduce a Dev Containers spec setup under .devcontainer/ so the project can
be opened one-click in VS Code, GitHub Codespaces, or any spec-compatible
editor, with Claude Code preinstalled.

To keep things DRY, service definitions are shared through a new
docker-compose.base.yaml that both the main stack and the dev container extend
via the compose extends: keyword, and the dev container image is a new
devcontainer stage in the existing app/Dockerfile rather than a duplicate
Dockerfile.

  • app/Dockerfile: split into base / devcontainer / production stages; the
    production stage stays last so the default build target (test compose and
    make build) is unchanged. The devcontainer stage adds a non-root vscode
    user and interactive tooling.
  • docker-compose.base.yaml: shared db, cache, and app (build) definitions.
  • docker-compose.yaml: refactored to extend the base; strictly
    behavior-preserving (verified with docker compose config).
  • .devcontainer/: devcontainer.json (Claude Code feature, VS Code extensions,
    forwarded ports), docker-compose.yml (extends base, inline dev env, Postgres
    persisted to a docker-data/devcontainer-db bind mount), and an idempotent
    post-create.sh that runs uv sync, migrations, fixture seeding, and default
    superuser creation, skipping seed steps when the DB is already populated.
  • .gitignore / Readme.md: ignore the dev container DB dir and document the
    workflow.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01SerCd5rRLrU1TsU8AHCXXQ

… Code

Introduce a Dev Containers spec setup under .devcontainer/ so the project can
be opened one-click in VS Code, GitHub Codespaces, or any spec-compatible
editor, with Claude Code preinstalled.

To keep things DRY, service definitions are shared through a new
docker-compose.base.yaml that both the main stack and the dev container extend
via the compose `extends:` keyword, and the dev container image is a new
`devcontainer` stage in the existing app/Dockerfile rather than a duplicate
Dockerfile.

- app/Dockerfile: split into base / devcontainer / production stages; the
  production stage stays last so the default build target (test compose and
  `make build`) is unchanged. The devcontainer stage adds a non-root `vscode`
  user and interactive tooling.
- docker-compose.base.yaml: shared db, cache, and app (build) definitions.
- docker-compose.yaml: refactored to extend the base; strictly
  behavior-preserving (verified with `docker compose config`).
- .devcontainer/: devcontainer.json (Claude Code feature, VS Code extensions,
  forwarded ports), docker-compose.yml (extends base, inline dev env, Postgres
  persisted to a docker-data/devcontainer-db bind mount), and an idempotent
  post-create.sh that runs uv sync, migrations, fixture seeding, and default
  superuser creation, skipping seed steps when the DB is already populated.
- .gitignore / Readme.md: ignore the dev container DB dir and document the
  workflow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SerCd5rRLrU1TsU8AHCXXQ
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.

2 participants