There appears to be a similar question as it about the predecessor to inspect
, and I want to use inspect
.
I have created a basic docker-compose stack from which I run my nodejs application. I want to listen for the debugger session and debug my JavaScript code within my local WebStorm.
I enter the container via
docker exec -it my_container bash
And I call my nodejs script with the debugger running via inspect
:
node --inspect ./cli.js start mytask
Debugger listening on ws://127.0.0.1:9229/81006264-163c-40d7-bd75-64c5e4fca618
For help see https://nodejs.org/en/docs/inspector
The linked help is not helpful to me as it assumes that I want to use the inspect
for a local run:
JetBrains WebStorm 2017.1+ and other JetBrains IDEs Create a new Node.js debug configuration and hit Debug. --inspect will be used by default for Node.js 7+. To disable uncheck js.debugger.node.use.inspect in the IDE Registry.
I want to attach to the run inside the docker container from my host WebStorm.
So when I run the script, it just completes never hitting any breakpoint.
I suppose I have to listen to the debugger, yet I do not know how.
I want my local WebStorm to connect to the nodejs debugger. I want to be able to debug within WebStorm as if I have run the nodejs script through WebStorm itself.
I tried digging through the docs yet I am unsure how to follow the guidelines.
I have exposed the default debug port 9229
to my local machine in my docker-compose.yml:
version: "3"
services:
my_container:
build: .
command: "bash"
hostname: my_container
tty: true
environment:
TERM: xterm
ports:
- "9229:9229"
I have no idea on how to listen to the nodejs debugger in WebStorm.