Skip to content

Add devcontainer config to use tools containerized such as Claude code or copilot#347

Draft
bazottie wants to merge 2 commits intomainfrom
feat/devcontainer
Draft

Add devcontainer config to use tools containerized such as Claude code or copilot#347
bazottie wants to merge 2 commits intomainfrom
feat/devcontainer

Conversation

@bazottie
Copy link
Copy Markdown
Member

Changes

  • Adds a .devcontainer folder
  • Adds devcontainer config including some tools and extensions
  • Adds post-create script that install deps

How to test

Test file

  1. Create a canary file somewhere in your system, i.e.
echo "SECRET_CANARY_VALUE_$(date +%s)" > ~/isolation-canary.txt
cat ~/isolation-canary.txt

Start up container

Vscode

  1. Open in vscode
  2. CMD+SHIFT+P "reopen in devcontainer"

CLI

  1. devcontainer up

Test an agent

  1. Try to cat the canary file from within the terminal in the container
  2. Ask claude or copilot to locate the canary file

Checklist

  • I have performed a self-review of my own code
  • I have made sure that my PR is easy to review (not too big, includes comments)
  • I have made updated relevant documentation files (in project README, docs/, etc)
  • I have added a decision log entry if the change affects the architecture or changes a significant technology
  • I have notified a reviewer

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json to define the container image, VS Code extensions, mounts, and post-create behavior.
  • Added a .devcontainer/post-create.sh script 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",
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"image": "mcr.microsoft.com/devcontainers/typescript-node:24",
"image": "mcr.microsoft.com/devcontainers/typescript-node:25",

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +13
echo "==> Installing Claude Code..."
npm install -g @anthropic-ai/claude-code
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}"

Copilot uses AI. Check for mistakes.
Comment thread .devcontainer/post-create.sh Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 14, 2026

Deploying head-start with  Cloudflare Pages  Cloudflare Pages

Latest commit: ee6b8fc
Status: ✅  Deploy successful!
Preview URL: https://25116e9e.head-start.pages.dev
Branch Preview URL: https://feat-devcontainer.head-start.pages.dev

View logs

@bazottie bazottie marked this pull request as draft April 16, 2026 07:16
@bazottie bazottie changed the title Add devcontainer config to use tools containerized sucha s Claude code and copilot Add devcontainer config to use tools containerized such as Claude code or copilot Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants