-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevcontainer.json
More file actions
66 lines (56 loc) · 3.51 KB
/
devcontainer.json
File metadata and controls
66 lines (56 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"name": "My Project",
// ── Image ─────────────────────────────────────────────────────────────────
"image": "ghcr.io/zanreal-labs/devcontainer:latest",
// ── Features ──────────────────────────────────────────────────────────────
// Only runtime + docker-in-docker. Everything else is installed by the
// interactive wizard on first container start (run: devcontainer-wizard).
// For CI/headless, set DEVCONTAINER_TOOLS env var (see below).
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": { "moby": false },
"ghcr.io/devcontainers/features/node:1": { "version": "22" }
},
// ── Runtime ───────────────────────────────────────────────────────────────
"runArgs": [
"--name", "my-project",
"--hostname", "my-project",
"--dns", "1.1.1.1",
"--dns", "8.8.8.8"
],
// ── Environment ───────────────────────────────────────────────────────────
"containerEnv": {
"DEVCONTAINER": "1",
"TURBO_CACHE_DIR": "/tmp/.turbo",
"BUN_INSTALL_CACHE_DIR": "/tmp/.bun-cache",
"SSH_AUTH_SOCK": "/run/host-services/ssh-auth.sock"
// For CI/headless: pre-install tools without the wizard
// "DEVCONTAINER_TOOLS": "claude-code,bun,supabase-cli,github-cli"
},
// ── Mounts ────────────────────────────────────────────────────────────────
// Containers are isolated — only git/ssh/gpg are forwarded from host.
"mounts": [
"source=my-project-node-modules,target=${containerWorkspaceFolder}/node_modules,type=volume",
// "target=${containerWorkspaceFolder}/apps/web/.next,type=volume",
// Git, SSH, GPG — staged to /tmp, setup.sh copies to $HOME (Zed-safe)
"source=${localEnv:HOME}/.gitconfig,target=/tmp/.host-gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}/.gnupg,target=/tmp/.host-gnupg,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/tmp/.host-ssh,type=bind,consistency=cached",
"source=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock,type=bind"
],
// ── Lifecycle ─────────────────────────────────────────────────────────────
// setup.sh handles git/ssh/gpg, package install, services, and launches
// the interactive wizard on first start. Add .devcontainer/post-setup.sh
// for project-specific steps.
"postCreateCommand": "bash /usr/local/share/devcontainer/setup.sh",
"otherPortsAttributes": { "onAutoForward": "ignore" },
// ── Editor ────────────────────────────────────────────────────────────────
"customizations": {
"vscode": {
"extensions": [
"bradlc.vscode-tailwindcss",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "vscode"
}