diff --git a/.devcontainer/dev/devcontainer.json b/.devcontainer/dev/devcontainer.json index 47825618..d49e148c 100644 --- a/.devcontainer/dev/devcontainer.json +++ b/.devcontainer/dev/devcontainer.json @@ -1,14 +1,49 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/go . { - "name": "pgEdge MCP Server — Development", - "image": "mcr.microsoft.com/devcontainers/go:1.24", - "features": { - "ghcr.io/devcontainers/features/node:1": { "version": "20" }, - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - }, - "customizations": { - "vscode": { - "extensions": ["golang.go"] - } - }, - "postCreateCommand": "go mod download && cd web && npm ci" + "name": "pgEdge MCP Server — Development", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/go:2-1.25-trixie", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": { + "installDirectlyFromGitHubRelease": true, + "version": "latest" + }, + "ghcr.io/devcontainers-extra/features/claude-code:1": { + "version": "latest" + } + }, + "mounts": [ + "source=${localEnv:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind", + "source=${localEnv:HOME}/.claude/commands,target=/home/vscode/.claude-host/commands,type=bind,readonly", + "source=${localEnv:HOME}/.claude/settings.json,target=/home/vscode/.claude-host/settings.json,type=bind,readonly" + ], + // The bind-mounted ~/.config/gh already authenticates the `gh` CLI + // inside the container, so we do not plumb GH_TOKEN through the + // environment; tools that need the raw token can call `gh auth token`. + "postCreateCommand": "mkdir -p ~/.claude && ln -sf ~/.claude-host/commands ~/.claude/commands && if [ -f ~/.claude-host/settings.json ]; then ln -sf ~/.claude-host/settings.json ~/.claude/settings.json; fi && grep -qxF 'alias claude=\"claude --dangerously-skip-permissions\"' ~/.bashrc || echo 'alias claude=\"claude --dangerously-skip-permissions\"' >> ~/.bashrc && sudo env \"PATH=$PATH\" npm update -g @anthropic-ai/claude-code", + "postAttachCommand": "echo '⚠️ NOTICE: This dev container aliases `claude` to `claude --dangerously-skip-permissions`. Run `unalias claude` or invoke `/usr/local/bin/claude` directly to restore safety prompts.'", + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [5173, 8000, 8080], + "portsAttributes": { + "5173": { + "label": "NLA", + "onAutoForward": "notify" + }, + "8000": { + "label": "Docs", + "onAutoForward": "notify" + }, + "8080": { + "label": "MCP", + "onAutoForward": "notify" + } + } + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" }