Tony
2022-11-16 14:39:46 +00:00
parent 297b3a7313
commit b5c8525069
4 changed files with 22 additions and 89 deletions
+19 -13
View File
@@ -1,14 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/javascript-node
// https://github.com/devcontainers/images/blob/v0.2.24/src/javascript-node/.devcontainer/devcontainer.json
{
"name": "Node.js",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": { "VARIANT": "16-bullseye" }
},
"image": "mcr.microsoft.com/devcontainers/javascript-node:16-bullseye",
// Configure tool-specific properties.
"customizations": {
@@ -34,23 +28,35 @@
"portsAttributes": {
"1200": {
"label": "app port",
"onAutoForward": "ignore"
"onAutoForward": "notify"
},
"8080": {
"label": "docs port",
"onAutoForward": "ignore"
"onAutoForward": "notify"
}
},
"onCreateCommand": "apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y install --no-install-recommends ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 wget xdg-utils redis-server && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*",
"updateContentCommand": "yarn",
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn",
// "postAttachCommand": "yarn dev",
// Disable auto start dev env since codespaces sometimes fails to attach to the terminal
// "postAttachCommand": {
// "app": "yarn",
// // "docs": "yarn docs:dev"
// },
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
"docker-in-docker": "latest",
"github-cli": "latest"
"ghcr.io/devcontainers/features/docker-in-docker": {
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli": {
"version": "latest"
}
}
}