···1111 # context: .
1212 # dockerfile: .devcontainer/Dockerfile
13131414- image: mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm
1414+ image: mcr.microsoft.com/devcontainers/javascript-node:20-bookworm
15151616 volumes:
1717 # Update this to wherever you want VS Code to mount the folder of your project
+2-3
.devcontainer/devcontainer.json
···2020 "forwardPorts": [9078,3000],
21212222 // Use 'postCreateCommand' to run commands after the container is created.
2323- "postCreateCommand": "npm install",
2323+ "postCreateCommand": ".devcontainer/postCreate.sh",
24242525 // Configure tool-specific properties.
2626 "customizations": {
···4141 "9078": {
4242 "label": "App"
4343 }
4444- },
4545- "onCreateCommand": "export PATH=/workspaces/node_modules/.bin:/workspaces/docsite/node_modules/.bin:$PATH"
4444+ }
46454746 // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
4847 // "remoteUser": "root"
+12
.devcontainer/postCreate.sh
···11+#!/usr/bin/env bash
22+33+echo 'Adding node_modules to path'
44+echo 'export PATH=/workspaces/node_modules/.bin:/workspaces/docsite/node_modules/.bin:$PATH' >> /home/node/.bashrc
55+66+echo 'Updating npm...'
77+npm install -g npm@11.12.1
88+99+echo 'Installing concurrently...'
1010+npm install -g concurrently
1111+1212+echo 'If you have freshly cloned this project or node_modules folder does not exist then you should run "npm run install:parallel" now'
+1-1
Dockerfile
···11FROM ghcr.io/linuxserver/baseimage-debian:bookworm AS base
2233ENV TZ=Etc/GMT
44-ENV NODE_VERSION=20.18.1
44+ENV NODE_VERSION=20.19.2
5566# borrowing openssl header removal trick from offical docker-node
77# https://github.com/nodejs/docker-node/blob/main/18/bookworm-slim/Dockerfile#L8