No one answered this? Did you figure anything out?
I am experimenting with a few ideas, based on Pavel's
blog: http://pavelpolyakov.com/2015/12/05/node-js-remote-debug-in-webstorm/
In the node application you can specify some convenience functions, e.g.
"scripts": {
"start": "node server.js",
"debug": "node --debug=5858 server.js"
},
Afterwards, you can override the runtime command line to specify *npm start*
or *npm debug*.
If you use docker-compose, you can specify a *.env* file, a default
variable:
MODE=start
Then in your *docker-compose.yml*
command: npm ${MODE}
Then on the command line you can do *MODE=debug docker-compose up -d *
Make sure that you point the default server from localhost to whatever the
output of *docker-machine ip*, if you are on OS X. If on Linux, then
localhost is fine.
Another idea I thought about was to specify a *DEBUG_OPTS* environment
variable, which is an empty string, but if *NODE_DEBUG=1*, then I set
*DEBUG_OPTS* to be equal to "*--debug=5858*". The only way to get
programatic functionality in Docker is to use a wrapper script, and
bootstrap the wrapper script instead of calling node directly. Most shops
that have to do complex things, seed/migrate an external database or other
application orchestration, then wrapper scripts are used. Otherwise, for
simple applications, *package.json* method is easier.
- Joaquin
On Saturday, February 14, 2015 at 11:57:54 AM UTC-8, Nik Sumeiko wrote:
>
> I have found Google provides some guidelines on how to run Nodejs on a
> custom runtime environment: https://cloud.google.com/solutions/nodejs
> 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.
>
> Nik Sumeiko
>
>
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/baba3920-2035-4f5e-a67e-9690f83efbfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.