microsoft/TypeAgent
Publicmirrored fromhttps://github.com/microsoft/TypeAgentAvailable
.devcontainer/devcontainer.json
125lines · modecode
| 1 | { |
| 2 | "name": "TypeAgent Development", |
| 3 | "build": { "dockerfile": "Dockerfile" }, |
| 4 | |
| 5 | // Multi-arch base image (linux/amd64 and linux/arm64) so this configuration |
| 6 | // works on Apple Silicon as well as x86_64 hosts. |
| 7 | // |
| 8 | // This configuration works with: |
| 9 | // - VS Code + Docker Desktop (local, including macOS arm64) |
| 10 | // - GitHub Codespaces (cloud) |
| 11 | // - JetBrains IDEs with Dev Containers support |
| 12 | |
| 13 | "features": { |
| 14 | "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {}, |
| 15 | "ghcr.io/devcontainers/features/sshd:1": { |
| 16 | "version": "latest" |
| 17 | }, |
| 18 | "ghcr.io/devcontainers/features/git-lfs:1": { |
| 19 | "autoPull": false |
| 20 | }, |
| 21 | "ghcr.io/devcontainers/features/node:1": { |
| 22 | "version": "22", |
| 23 | "nodeGypDependencies": true |
| 24 | }, |
| 25 | "ghcr.io/devcontainers/features/python:1": { |
| 26 | "version": "3.12", |
| 27 | "installTools": true |
| 28 | }, |
| 29 | "ghcr.io/devcontainers/features/dotnet:2": { |
| 30 | "version": "8.0" |
| 31 | }, |
| 32 | "ghcr.io/devcontainers/features/azure-cli:1": {}, |
| 33 | "ghcr.io/devcontainers/features/github-cli:1": {}, |
| 34 | // base:ubuntu-24.04 does not pre-install zsh / oh-my-zsh, so add common-utils |
| 35 | // and create the non-root `codespace` user expected by the rest of this config. |
| 36 | "ghcr.io/devcontainers/features/common-utils:2": { |
| 37 | "installZsh": true, |
| 38 | "configureZshAsDefaultShell": true, |
| 39 | "installOhMyZsh": true, |
| 40 | "username": "codespace", |
| 41 | "userUid": "1001", |
| 42 | "userGid": "1001" |
| 43 | } |
| 44 | }, |
| 45 | |
| 46 | // Publish SSH port on loopback only so host-side `ssh typeagent-devcontainer` |
| 47 | // works without exposing 2222 on the LAN. Plain `forwardPorts` is only |
| 48 | // honored by the VS Code / Codespaces port-forwarding UI and does NOT |
| 49 | // actually publish the port when the container is started via the |
| 50 | // devcontainer CLI, which leaves `localhost:2222` unreachable. |
| 51 | "appPort": ["127.0.0.1:2222:2222"], |
| 52 | |
| 53 | "forwardPorts": [8999, 8081, 8082, 3000, 3443], |
| 54 | "portsAttributes": { |
| 55 | "8999": { "label": "Agent Server (WebSocket)", "onAutoForward": "notify" }, |
| 56 | "8081": { "label": "Browser Agent (WebSocket)", "onAutoForward": "notify" }, |
| 57 | "8082": { "label": "Code Agent (WebSocket)", "onAutoForward": "notify" }, |
| 58 | "3000": { "label": "API Server (HTTP)", "onAutoForward": "notify" }, |
| 59 | "3443": { "label": "API Server (HTTPS)", "onAutoForward": "notify" } |
| 60 | }, |
| 61 | |
| 62 | "mounts": [ |
| 63 | // Global pnpm store - shared across containers for fast installs |
| 64 | "source=pnpm-global-store,target=/home/codespace/.local/share/pnpm/store,type=volume", |
| 65 | // Per-container node_modules (symlinks to global store) |
| 66 | "source=typeagent-node_modules-${devcontainerId},target=${containerWorkspaceFolder}/ts/node_modules,type=volume", |
| 67 | // Claude Code config persistence |
| 68 | "source=claude-code-config-${devcontainerId},target=/home/codespace/.claude,type=volume", |
| 69 | // Copilot CLI chat log persistence |
| 70 | "source=copilot-cli-config-${devcontainerId},target=/home/codespace/.copilot,type=volume", |
| 71 | // VS Code server data (extensions, settings cache, workspace storage, history) |
| 72 | // so editor state survives container recreate. |
| 73 | "source=vscode-server-${devcontainerId},target=/home/codespace/.vscode-server,type=volume" |
| 74 | ], |
| 75 | |
| 76 | "containerEnv": { |
| 77 | "LOCAL_GIT_USER_NAME": "${localEnv:LOCAL_GIT_USER_NAME}", |
| 78 | "LOCAL_GIT_USER_EMAIL": "${localEnv:LOCAL_GIT_USER_EMAIL}" |
| 79 | // For Codespaces, set these as repository secrets: |
| 80 | // - AZURE_OPENAI_API_KEY |
| 81 | // - AZURE_OPENAI_ENDPOINT |
| 82 | // - ANTHROPIC_API_KEY (for Claude Code) |
| 83 | }, |
| 84 | |
| 85 | "postCreateCommand": "bash .devcontainer/scripts/post-create.sh", |
| 86 | "postStartCommand": "bash .devcontainer/scripts/post-start.sh", |
| 87 | |
| 88 | "customizations": { |
| 89 | "vscode": { |
| 90 | "extensions": [ |
| 91 | "dbaeumer.vscode-eslint", |
| 92 | "esbenp.prettier-vscode", |
| 93 | "ms-python.python", |
| 94 | "ms-python.vscode-pylance", |
| 95 | "ms-dotnettools.csharp", |
| 96 | "ms-azuretools.vscode-azurefunctions", |
| 97 | "github.copilot", |
| 98 | "humao.rest-client" |
| 99 | ], |
| 100 | "settings": { |
| 101 | "editor.formatOnSave": true, |
| 102 | "editor.defaultFormatter": "esbenp.prettier-vscode", |
| 103 | "typescript.tsdk": "node_modules/typescript/lib", |
| 104 | "terminal.integrated.defaultProfile.linux": "zsh" |
| 105 | } |
| 106 | }, |
| 107 | // Codespaces-specific settings |
| 108 | "codespaces": { |
| 109 | "openFiles": [ |
| 110 | "ts/README.md" |
| 111 | ] |
| 112 | } |
| 113 | }, |
| 114 | |
| 115 | "remoteUser": "codespace", |
| 116 | |
| 117 | // Resource requirements |
| 118 | // Codespaces: Choose "4-core" or higher machine type |
| 119 | // Local: Ensure Docker has at least these resources allocated |
| 120 | "hostRequirements": { |
| 121 | "cpus": 4, |
| 122 | "memory": "8gb", |
| 123 | "storage": "32gb" |
| 124 | } |
| 125 | } |
| 126 | |