| 1 | // Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 24, Rust stable) |
| 2 | // and the canonical setup in docs/operations/development.md: global `vp`, `vp i`. |
| 3 | // Contributor doc: docs/internals/devcontainer.md |
| 4 | { |
| 5 | "name": "T3 Code", |
| 6 | "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", |
| 7 | "features": { |
| 8 | // nodeGypDependencies (default true) brings python3/make/g++, which Linux |
| 9 | // needs for node-pty's node-gyp fallback (its prebuilds are mac/win only). |
| 10 | "ghcr.io/devcontainers/features/node:2": { |
| 11 | "version": "24" |
| 12 | }, |
| 13 | // native/resource-monitor (edition 2024, needs stable >= 1.85). The server |
| 14 | // degrades gracefully without the binary, but CI checks cargo fmt + test. |
| 15 | "ghcr.io/devcontainers/features/rust:1": {}, |
| 16 | "ghcr.io/devcontainers/features/github-cli:1": {} |
| 17 | }, |
| 18 | "hostRequirements": { |
| 19 | "cpus": 4, |
| 20 | "memory": "8gb", |
| 21 | "storage": "32gb" |
| 22 | }, |
| 23 | "containerEnv": { |
| 24 | // Keep all runtime state inside the (gitignored) workspace .t3, matching |
| 25 | // the worktree default. An explicit --home-dir still wins. |
| 26 | "T3CODE_HOME": "${containerWorkspaceFolder}/.t3" |
| 27 | }, |
| 28 | "mounts": [ |
| 29 | // vp keeps the pnpm content-addressable store and metadata cache under |
| 30 | // ~/.cache/pnpm (verified: the v11 store dir lives there); mounting a |
| 31 | // volume there lets installs survive container rebuilds. |
| 32 | "source=t3code-pnpm-store,target=/home/vscode/.cache/pnpm,type=volume", |
| 33 | // Root node_modules holds the whole pnpm virtual store (.pnpm), so one |
| 34 | // volume keeps the heavy tree off the slow macOS/Windows bind mount. |
| 35 | // Scoped by devcontainerId so parallel checkouts do not share it. |
| 36 | // Codespaces note: prebuild snapshots exclude volumes; drop these mounts |
| 37 | // if prebuilt codespaces become the primary workflow. |
| 38 | "source=t3code-node-modules-${devcontainerId},target=${containerWorkspaceFolder}/node_modules,type=volume" |
| 39 | ], |
| 40 | "onCreateCommand": "bash .devcontainer/on-create.sh", |
| 41 | "updateContentCommand": "bash .devcontainer/update-content.sh", |
| 42 | "forwardPorts": [5733, 13773], |
| 43 | "portsAttributes": { |
| 44 | "5733": { |
| 45 | "label": "t3 web (open via the pairing URL, not the bare origin)", |
| 46 | "onAutoForward": "notify" |
| 47 | }, |
| 48 | "13773": { |
| 49 | "label": "t3 server", |
| 50 | "onAutoForward": "silent" |
| 51 | } |
| 52 | }, |
| 53 | "customizations": { |
| 54 | "codespaces": { |
| 55 | "openFiles": ["docs/internals/devcontainer.md"] |
| 56 | }, |
| 57 | "vscode": { |
| 58 | "extensions": ["oxc.oxc-vscode", "rust-lang.rust-analyzer"], |
| 59 | "settings": { |
| 60 | // .repos is a large vendored read-only reference tree; watching it |
| 61 | // burns CPU and file handles. |
| 62 | "files.watcherExclude": { |
| 63 | "**/.repos/**": true, |
| 64 | "**/.t3/**": true |
| 65 | }, |
| 66 | "search.exclude": { |
| 67 | "**/.repos": true |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | }, |
| 72 | "remoteUser": "vscode" |
| 73 | } |