1

I'm running a node.js application inside a Docker container. I need to debug this application with Intellij Ultimate 15.

demoapp:
  build: .
  command: 'bash -c "npm install && npm run debug"'
  ports:
    - "8989:8989"
  environment:
      VIRTUAL_HOST: 'demoapp.docker'
      VIRTUAL_PORT: 8989

The debug script from package.json

"debug": "(node-inspector --web-port=8989  app.js &) && node --debug app.js"

And the configuration in the IDE

enter image description here

The IDE responds with a Frame is not available. I guess it couldn't connect.

Am I doing something wrong?

Moreover, I'm able to debug using Chrome. If I visit the demoapp.docker:8989 it connects and I can start debugging.

Alkis Kalogeris
  • 17,044
  • 15
  • 59
  • 113

1 Answers1

2

You should connect to the debug port via IntelliJ debugger, not to the web port. So you should specify it (with the --debug option) on the node runtime and expose it to the docker host and after that you'll be able to connect to it.

More info in the JetBrains documentation: https://www.jetbrains.com/idea/help/running-and-debugging-node-js.html#remote_debugging

mishunika
  • 1,876
  • 1
  • 16
  • 20