|
| 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 |
1 | 4 | { |
2 | | - "name": "T3 Code Dev", |
3 | | - "image": "debian:bookworm", |
| 5 | + "name": "T3 Code", |
| 6 | + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04", |
4 | 7 | "features": { |
5 | | - "ghcr.io/devcontainers/features/git:1": {}, |
6 | | - "ghcr.io/devcontainers-extra/features/bun:1": { |
7 | | - "version": "1.3.11" |
| 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" |
8 | 12 | }, |
9 | | - "ghcr.io/devcontainers/features/node:1": { |
10 | | - "version": "24.13.1" |
11 | | - }, |
12 | | - "ghcr.io/devcontainers/features/python:1": { |
13 | | - "version": "3.10", |
14 | | - "installTools": false |
15 | | - } |
| 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" |
16 | 27 | }, |
17 | | - "overrideFeatureInstallOrder": [ |
18 | | - "ghcr.io/devcontainers/features/git", |
19 | | - "ghcr.io/devcontainers-extra/features/bun" |
| 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" |
20 | 39 | ], |
21 | | - "postCreateCommand": { |
22 | | - "bun-install": "bun install --backend=copyfile --frozen-lockfile" |
| 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 | + } |
23 | 52 | }, |
24 | 53 | "customizations": { |
| 54 | + "codespaces": { |
| 55 | + "openFiles": ["docs/internals/devcontainer.md"] |
| 56 | + }, |
25 | 57 | "vscode": { |
26 | | - "extensions": ["oxc.oxc-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 | + } |
27 | 70 | } |
28 | | - } |
| 71 | + }, |
| 72 | + "remoteUser": "vscode" |
29 | 73 | } |
0 commit comments