Sunday, 23 April 2017

Debug Node (>=6.3) from a docker container

I have a docker container which uses pm2 to run node like so:

#process.yml
apps:

  - script: ./index.js
    name: client
    watch: true
    args: --inspect

 #Dockerfile

 CMD pm2-docker process.yml

As I could read in that post: The node inspector has arrived in the core of node.js and running a script like so:

node --inspect <somescript.js>

gives some output on the commandline like that: chrome-devtools://… and navigating to that url in chrome, will fire up node-inspector.

How can I do that for a node instance that lives inside a container, but should be debugged from the host.



via philipp

No comments:

Post a Comment