DockerHub VsCode devcontainer NodeJS configurable image, with Intellisense & hot-reloading.
571
Registry: DockerHub
Source code: GitHub (private)
Demo project: GitHub (pending)
nodemon - for hot-reloading your appClone the demo-project branch in an empty directory: [PENDING]
git clone --branch=demo-project https://github.com/google85/vscode-devcontainer-node.git node-project
cd node-project/
Open project in VsCode
code .
Use VsCode Reopen in DevContainer option.
Open a terminal in VsCode and type:
cd src/
make
Pull the image
docker pull google85/vscode-devcontainer-node:20.11.1
Create a .devcontainer folder in the root of your project
mkdir -p .devcontainer
Create the devcontainer.json configuration file
cat <<EOF | tee .devcontainer/devcontainer.json
{
"name": "node-project",
"dockerComposeFile": "docker-compose.devcontainer.yml",
"service": "node-devcontainer",
"workspaceFolder": "/home/node/app",
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/node/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/root/.ssh,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.gitconfig,target=/root/.gitconfig,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"settings": {
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
]
}
},
"postCreateCommand": "after-setup.sh",
"forwardPorts": [
// 8000
]
}
EOF
Create the docker-compose.devcontainer.yml to be used
cat <<EOF | tee .devcontainer/docker-compose.devcontainer.yml
version: '3'
services:
node-devcontainer:
image: google85/vscode-devcontainer-node:20.11.1
hostname: node-devcontainer
working_dir: /home/node/app
#env_file:
#- ../.env
environment:
- TZ=Europe/Bucharest
volumes:
- ..:/home/node/app
extra_hosts:
- "host.docker.internal:host-gateway"
tty: true # very important
EOF
Open project in VsCode
Use VsCode Reopen in DevContainer option.
Content type
Image
Digest
sha256:66b55566b…
Size
359 MB
Last updated
over 2 years ago
docker pull google85/vscode-devcontainer-node