Skip to content

Commit 5d9c3e6

Browse files
committed
Add devcontainer configuration
Add configuration files for creating docker container
1 parent 19b4ced commit 5d9c3e6

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
ARG VARIANT=24-trixie
3+
FROM mcr.microsoft.com/devcontainers/javascript-node:4-${VARIANT}
4+
5+
# Install tslint, typescript. eslint is installed by javascript image
6+
ARG NODE_MODULES="tslint-to-eslint-config typescript"
7+
RUN su node -c "umask 0002 && npm install -g ${NODE_MODULES}" \
8+
&& npm cache clean --force > /dev/null 2>&1
9+
10+
# [Optional] Uncomment this section to install additional OS packages.
11+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12+
# && apt-get -y install --no-install-recommends <your-package-list-here>
13+
14+
# [Optional] Uncomment if you want to install an additional version of node using nvm
15+
# ARG EXTRA_NODE_VERSION=10
16+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
17+
18+
# [Optional] Uncomment if you want to install more global node packages
19+
# RUN su node -c "npm install -g <your-package-list -here>"

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Node.js & TypeScript",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/git:1": {
8+
"version": "latest",
9+
"ppa": "false"
10+
}
11+
},
12+
13+
// Configure tool-specific properties.
14+
"customizations": {
15+
// Configure properties specific to VS Code.
16+
"vscode": {
17+
// Add the IDs of extensions you want installed when the container is created.
18+
"extensions": [
19+
"dbaeumer.vscode-eslint"
20+
],
21+
"settings": {
22+
"github.copilot.chat.codeGeneration.instructions": [
23+
{
24+
"text": "This dev container includes the TypeScript compiler (`tsc`) pre-installed and available on the `PATH` for TypeScript development."
25+
}
26+
]
27+
}
28+
}
29+
},
30+
31+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
32+
// "forwardPorts": [],
33+
34+
// Use 'postCreateCommand' to run commands after the container is created.
35+
// "postCreateCommand": "yarn install",
36+
37+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
38+
"remoteUser": "node"
39+
}

0 commit comments

Comments
 (0)