|
1 | 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: |
2 | 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node |
| 3 | +// - |
3 | 4 | { |
4 | | - "name": "docs.github.com", |
5 | | - "build": { |
6 | | - "dockerfile": "Dockerfile", |
7 | | - // Update 'VARIANT' to pick a Node version: 12, 14, 16 |
8 | | - "args": { "VARIANT": "16" } |
9 | | - }, |
| 5 | + "name": "docs.github.com", |
| 6 | + "build": { |
| 7 | + "dockerfile": "Dockerfile", |
| 8 | + // Update 'VARIANT' to pick a Node version |
| 9 | + "args": { "VARIANT": "22" } |
| 10 | + }, |
10 | 11 |
|
11 | | - // Set *default* container specific settings.json values on container create. |
12 | | - "settings": { |
13 | | - "terminal.integrated.shell.linux": "/bin/bash", |
14 | | - "cSpell.language": ",en" |
15 | | - }, |
| 12 | + // Install features. Type 'feature' in the VS Code command palette for a full list. |
| 13 | + "features": { |
| 14 | + "sshd": "latest", |
| 15 | + "ghcr.io/devcontainers/features/github-cli:1": {} |
| 16 | + }, |
16 | 17 |
|
17 | | - // Visual Studio Code extensions which help authoring for docs.github.com. |
18 | | - "extensions": [ |
19 | | - "dbaeumer.vscode-eslint", |
20 | | - "sissel.shopify-liquid", |
21 | | - "davidanson.vscode-markdownlint", |
22 | | - "bierner.markdown-preview-github-styles", |
23 | | - "yzhang.markdown-all-in-one", |
24 | | - "streetsidesoftware.code-spell-checker" |
25 | | - ], |
| 18 | + "customizations": { |
| 19 | + "vscode": { |
| 20 | + // Set *default* container specific settings.json values on container create. |
| 21 | + "settings": { |
| 22 | + "terminal.integrated.shell.linux": "/bin/bash", |
| 23 | + "cSpell.language": ",en", |
| 24 | + "git.autofetch": true |
| 25 | + }, |
| 26 | + // Visual Studio Code extensions which help authoring for docs.github.com. |
| 27 | + "extensions": [ |
| 28 | + "dbaeumer.vscode-eslint", |
| 29 | + "sissel.shopify-liquid", |
| 30 | + "davidanson.vscode-markdownlint", |
| 31 | + "bierner.markdown-preview-github-styles", |
| 32 | + "streetsidesoftware.code-spell-checker", |
| 33 | + "alistairchristie.open-reusables", |
| 34 | + "AlistairChristie.version-identifier", |
| 35 | + "peterbe.ghdocs-goer", |
| 36 | + "GitHub.copilot", |
| 37 | + "GitHub.copilot-chat" |
| 38 | + ] |
| 39 | + }, |
| 40 | + "codespaces": { |
| 41 | + "repositories": { |
| 42 | + // allow Codespaces to pull from separate repo when user has access |
| 43 | + "github/docs-early-access": { |
| 44 | + "permissions": { |
| 45 | + "contents": "write" |
| 46 | + } |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + }, |
26 | 51 |
|
27 | | - // Use 'forwardPorts' to make a list of ports inside the container available locally. |
28 | | - "forwardPorts": [4000], |
| 52 | + // Use 'forwardPorts' to make a list of ports inside the container available locally. |
| 53 | + "forwardPorts": [4000], |
29 | 54 |
|
30 | | - // Use 'postCreateCommand' to run commands after the container is created. |
31 | | - "postCreateCommand": "npm ci && npm run build", |
| 55 | + "portsAttributes": { |
| 56 | + "4000": { |
| 57 | + "label": "Review" |
| 58 | + } |
| 59 | + }, |
32 | 60 |
|
33 | | - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
34 | | - "remoteUser": "node" |
| 61 | + // Lifecycle commands |
| 62 | + "onCreateCommand": "npm ci", |
| 63 | + "postStartCommand": "nohup bash -c 'npm start &'", |
| 64 | + // Set the port to be public |
| 65 | + "postAttachCommand": "gh cs ports visibility 4000:public -c \"$CODESPACE_NAME\"", |
| 66 | + |
| 67 | + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
| 68 | + "remoteUser": "node", |
| 69 | + |
| 70 | + "hostRequirements": { |
| 71 | + "memory": "16gb", |
| 72 | + "cpus": "4" |
| 73 | + } |
35 | 74 | } |
0 commit comments