Skip to content

Commit 4e449ae

Browse files
committed
Add basic dev container
1 parent b2a242d commit 4e449ae

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/typescript-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/typescript-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+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12+
&& apt-get install -y wget gnupg \
13+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
14+
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
15+
&& apt-get update \
16+
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
17+
--no-install-recommends \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
21+
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/google-chrome-stable
22+
23+
# [Optional] Uncomment if you want to install an additional version of node using nvm
24+
# ARG EXTRA_NODE_VERSION=10
25+
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
26+
27+
# [Optional] Uncomment if you want to install more global node packages
28+
# RUN su node -c "npm install -g <your-package-list -here>"

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.183.0/containers/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick a Node version: 12, 14, 16
8+
"args": {
9+
"VARIANT": "16-buster"
10+
}
11+
},
12+
13+
// Set *default* container specific settings.json values on container create.
14+
"settings": {},
15+
16+
// Add the IDs of extensions you want installed when the container is created.
17+
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
18+
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
// "forwardPorts": [],
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
"postCreateCommand": "yarn install",
24+
25+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
26+
"remoteUser": "node"
27+
}

0 commit comments

Comments
 (0)