We'll start with the easiest one—a Node.js application. We will use our sample application in folder ~/fod/ch06/node, which we worked with earlier in this chapter:
- Make sure that you navigate to this project folder and open VS Code from within it:
$ cd ~/fod/ch06/node$ code .
- In the terminal window, from within the project folder, run a container with our sample Node.js application:
$ docker container run --rm -it \ --name my-sample-app \ -p 3000:3000 \ -p 9229:9229 \ -v $(pwd):/app \ sample-app node --inspect=0.0.0.0 index.js
Note how I map port 9229 to the host. This port is used by the debugger, and VS Studio will communicate with our Node application via this port. Thus it is important that you open ...