|
| 1 | +{ |
| 2 | + "name": "Payload Monorepo", |
| 3 | + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", |
| 4 | + "features": { |
| 5 | + "ghcr.io/payloadcms/devcontainer-features/mise-bootstrap:1": {}, |
| 6 | + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, |
| 7 | + "ghcr.io/devcontainers/features/common-utils:2": { |
| 8 | + "configureZshAsDefaultShell": true, |
| 9 | + "installZsh": true, |
| 10 | + "installOhMyZsh": true, |
| 11 | + "installOhMyZshConfig": true, |
| 12 | + "upgradePackages": true |
| 13 | + } |
| 14 | + }, |
| 15 | + // Runs before feature postCreateCommands so the named volume is writable |
| 16 | + // by the time mise-bootstrap tries to install into node_modules. |
| 17 | + "onCreateCommand": "sudo chown vscode:vscode ${containerWorkspaceFolder}/node_modules", |
| 18 | + // setup.sh auto-detects bind-mount vs volume-clone mode and handles both. |
| 19 | + "postCreateCommand": ".devcontainer/setup.sh", |
| 20 | + // Only the Next.js dev server should be forwarded |
| 21 | + "forwardPorts": [3000], |
| 22 | + "portsAttributes": { |
| 23 | + "3000": { |
| 24 | + "label": "Next Dev Server" |
| 25 | + } |
| 26 | + }, |
| 27 | + "customizations": { |
| 28 | + "vscode": { |
| 29 | + "extensions": [ |
| 30 | + "anthropic.claude-code", |
| 31 | + "dbaeumer.vscode-eslint", |
| 32 | + "esbenp.prettier-vscode", |
| 33 | + "eamodio.gitlens", |
| 34 | + "hverlin.mise-vscode", |
| 35 | + "stylelint.vscode-stylelint", |
| 36 | + "vitest.explorer", |
| 37 | + "ms-playwright.playwright" |
| 38 | + ], |
| 39 | + "settings": { |
| 40 | + "terminal.integrated.defaultProfile.linux": "zsh", |
| 41 | + "terminal.integrated.profiles.linux": { |
| 42 | + "zsh": { |
| 43 | + "path": "zsh" |
| 44 | + } |
| 45 | + }, |
| 46 | + // Stop VS Code from auto-forwarding every ephemeral port a process opens. |
| 47 | + // Only ports in `forwardPorts` above are exposed. |
| 48 | + "remote.autoForwardPorts": false |
| 49 | + } |
| 50 | + } |
| 51 | + }, |
| 52 | + // Allows us to detect whether we are within a devcontainer |
| 53 | + "containerEnv": { |
| 54 | + "DEVCONTAINER": "true" |
| 55 | + }, |
| 56 | + // node_modules volume: isolates linux-arm64 installs from darwin-arm64 host |
| 57 | + // files in bind-mount mode. |
| 58 | + "mounts": [ |
| 59 | + "source=${containerWorkspaceFolderBasename}-node-modules,target=${containerWorkspaceFolder}/node_modules,type=volume" |
| 60 | + ] |
| 61 | +} |
0 commit comments