Skip to content

Commit a4a440a

Browse files
tortmayrsdirix
authored andcommitted
Remote container setup for VS-Code
Setup a remote container dev setup using the "ms-vscode-remote.remote-containers" extension
1 parent 83da998 commit a4a440a

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 16, 14, 12
4+
ARG VARIANT="16-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
# && apt-get -y install --no-install-recommends <your-package-list-here>
10+
11+
# [Optional] Uncomment if you want to install an additional version of node using nvm
12+
# ARG EXTRA_NODE_VERSION=10
13+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
14+
15+
# [Optional] Uncomment if you want to install more global node modules
16+
# RUN su node -c "npm install -g <your-package-list-here>"

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/javascript-node
3+
{
4+
"name": "Node.js",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 12, 14, 16
8+
"args": {
9+
"VARIANT": "12"
10+
}
11+
},
12+
// Set *default* container specific settings.json values on container create.
13+
// Add the IDs of extensions you want installed when the container is created.
14+
"extensions": [
15+
"esbenp.prettier-vscode",
16+
"ms-vscode.vscode-typescript-tslint-plugin"
17+
],
18+
"settings": {
19+
"editor.formatOnSave": false,
20+
"editor.defaultFormatter": "esbenp.prettier-vscode",
21+
"prettier.jsxSingleQuote": true,
22+
"prettier.singleQuote": true
23+
},
24+
25+
// Use 'postCreateCommand' to run commands after the container is created.
26+
"postCreateCommand": "npm ci && npm run init && npm run build",
27+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
28+
"remoteUser": "node"
29+
}

.vscode/extensions.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// List of extensions which should be recommended for users of this workspace.
66
"recommendations": [
77
"esbenp.prettier-vscode",
8-
"ms-vscode.vscode-typescript-tslint-plugin"
8+
"ms-vscode.vscode-typescript-tslint-plugin",
9+
"ms-vscode-remote.remote-containers"
10+
911
],
1012
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1113
"unwantedRecommendations": []

0 commit comments

Comments
 (0)