How to debug Nodejs app running inside Docker container via Google Cloud

Nik Sumeiko picture Nik Sumeiko · Feb 14, 2015 · Viewed 9.4k times · Source

I have found Google provides some guidelines on how to run Nodejs on a custom runtime environment. Everything seems fine and I am managing to start my Nodejs app on local machine running gcloud preview app run ..
As I can see, it probably creates a Docker container and runs Nodejs program in there. I am saying "probably", because it is my first experience with Docker, however I am 2+ years experienced Nodejs developer.

So my question is how to debug (with breakpoint stops) my Nodejs program when it is running inside Docker container? Using Chrome Developer Tools or how can I set up Webstorm debug configuration to make it stop on breakpoints. Is it possible to configure Docker on how it starts node or even start Docker via gcloud inside Webstorm to assure debugging is working? Any help or clarifications are appreciated.

Please don't provide answers on how to debug Nodejs app outside of Docker container – I know how to do that very well.

Answer

user1853777 picture user1853777 · Mar 11, 2015

I'm sorry, but I only know a solution with node-inspector, I hope it can help you: