Add devcontainer config to use tools containerized such as Claude code or copilot#347
Add devcontainer config to use tools containerized such as Claude code or copilot#347
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Dev Container setup so contributors can develop and run AI tooling (Claude Code + GitHub Copilot) in an isolated, containerized environment for this Astro project.
Changes:
- Added a
.devcontainer/devcontainer.jsonto define the container image, VS Code extensions, mounts, and post-create behavior. - Added a
.devcontainer/post-create.shscript to install project dependencies and Claude Code during container creation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .devcontainer/devcontainer.json | Defines the devcontainer image/user, persistent Claude config volume, VS Code extensions/settings, and environment variables. |
| .devcontainer/post-create.sh | Installs npm dependencies and globally installs Claude Code as part of postCreateCommand. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,46 @@ | |||
| { | |||
| "name": "Astro + Claude Code + Copilot", | |||
| "image": "mcr.microsoft.com/devcontainers/typescript-node:24", | |||
There was a problem hiding this comment.
The devcontainer image is pinned to Node 24, but the repository’s .node-version is v25. This mismatch can lead to hard-to-reproduce local issues (different dependency trees, tooling behavior). Align the devcontainer Node version with the project’s declared Node version (or update .node-version if 24 is intended).
| "image": "mcr.microsoft.com/devcontainers/typescript-node:24", | |
| "image": "mcr.microsoft.com/devcontainers/typescript-node:25", |
| echo "==> Installing Claude Code..." | ||
| npm install -g @anthropic-ai/claude-code |
There was a problem hiding this comment.
npm install -g @anthropic-ai/claude-code installs the latest version on every rebuild, which reduces reproducibility and can break unexpectedly if a new release ships. Consider pinning the version (or adding it as a devDependency and invoking a fixed version) so the devcontainer environment is deterministic.
| echo "==> Installing Claude Code..." | |
| npm install -g @anthropic-ai/claude-code | |
| CLAUDE_CODE_VERSION="1.0.64" | |
| echo "==> Installing Claude Code..." | |
| npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Deploying head-start with
|
| Latest commit: |
ee6b8fc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://25116e9e.head-start.pages.dev |
| Branch Preview URL: | https://feat-devcontainer.head-start.pages.dev |
Changes
.devcontainerfolderHow to test
Test file
Start up container
Vscode
CLI
devcontainer upTest an agent
Checklist