|
98 | 98 | // start). Use it for one-time setup: installing dependencies, configuring |
99 | 99 | // git hooks, seeding databases, etc. |
100 | 100 | // Chain commands with && so the step fails fast if anything goes wrong. |
101 | | - "postCreateCommand": "git config core.hooksPath .githooks", |
| 101 | + "postCreateCommand": "cp -rn /tmp/host-config/. ~/.config/ && git config core.hooksPath .githooks", |
102 | 102 |
|
103 | 103 | // postStartCommand runs on every container start (including resume). |
104 | 104 | // Keep it fast. Good for starting background services or printing a welcome |
|
137 | 137 | // enable it in your personal ~/.gitconfig if you want signed commits). |
138 | 138 | "source=${localEnv:HOME}/.gnupg,target=/home/node/.gnupg,type=bind,consistency=cached,readonly", |
139 | 139 |
|
140 | | - // XDG config directory - shares config for all tools (opencode, gh, etc.) |
141 | | - // so you don't need to re-authenticate or reconfigure on every rebuild. |
142 | | - // Tradeoff: the container can read all your tool configs including tokens. |
143 | | - // Acceptable for a trusted personal dev container; use per-tool mounts if |
144 | | - // you prefer tighter isolation (e.g. ~/.config/opencode, ~/.config/gh). |
145 | | - "source=${localEnv:HOME}/.config,target=/home/node/.config,type=bind,consistency=cached" |
| 140 | + // XDG config directory mounted to a staging path. postCreateCommand copies |
| 141 | + // it to ~/.config so the container gets a snapshot at creation time rather |
| 142 | + // than a live link - changes inside the container don't affect the host. |
| 143 | + "source=${localEnv:HOME}/.config,target=/tmp/host-config,type=bind,consistency=cached,readonly" |
146 | 144 |
|
147 | 145 | // Named volume for the pnpm content-addressable store. Sharing a store |
148 | 146 | // across rebuilds avoids re-downloading packages. Uncomment if your |
|
0 commit comments