Skip to content

Instantly share code, notes, and snippets.

@bluebrown
Created May 18, 2020 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bluebrown/a3930c23633f6f524bfc7d2da1457410 to your computer and use it in GitHub Desktop.
Save bluebrown/a3930c23633f6f524bfc7d2da1457410 to your computer and use it in GitHub Desktop.
VS Code Sample .devcontainer.json
{
"name": "sample-devcontainer",
"image": "node",
"workspaceFolder": "/sample-devcontainer",
"workspaceMount": "source=sample-devcontainer,target=/sample-devcontainer,type=volume",
"mounts": [ // reuse global node modules and vscode extensions across containers
"source=npm_global,target=/npm_global,type=volume",
"source=javascript_vscode_extensions,target=/root/.vscode-server/extensions,type=volume",
],
"postCreateCommand": "npm config set prefix '/npm_global'",
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/npm_global/bin",
},
"forwardPorts": [8080, 7020],
"runArgs": [ "--network=host"], // to access services on the host network
"extensions": [
"steoates.autoimport",
"dbaeumer.vscode-eslint",
"xabikos.javascriptsnippets",
"dsznajder.es7-react-js-snippets",
"sburg.vscode-javascript-booster",
"christian-kohler.path-intellisense",
"christian-kohler.npm-intellisense",
"digitalbrainstem.javascript-ejs-support",
"taodongwu.ejs-snippets",
"theran.ejs-snippets"
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment