https://github.com/mendhak/webstorm-dockercompose-cluster-debug
Attempting to attach webstorm's debugger to an express app, which uses Node's cluster, running via docker compose
https://github.com/mendhak/webstorm-dockercompose-cluster-debug
Last synced: 9 months ago
JSON representation
Attempting to attach webstorm's debugger to an express app, which uses Node's cluster, running via docker compose
- Host: GitHub
- URL: https://github.com/mendhak/webstorm-dockercompose-cluster-debug
- Owner: mendhak
- Created: 2018-01-04T13:09:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-04T16:21:16.000Z (about 8 years ago)
- Last Synced: 2025-02-12T06:38:44.503Z (11 months ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Steps
Attempting to attach webstorm's debugger to an express app, which uses Node's cluster, running via docker compose
1. git clone https://github.com/mendhak/webstorm-dockercompose-cluster-debug.git
2. Open that project in WebStorm, run `npm install`
3. Ensure there's a breakpoint in routes/index.js [on line 6](https://github.com/mendhak/webstorm-dockercompose-cluster-debug/blob/master/routes/index.js#L6).
4. Look at the bin/www file and notice how the cluster.fork() is being created. One [child for each CPU core](https://github.com/mendhak/webstorm-dockercompose-cluster-debug/blob/master/bin/www#L22-L24).
5. In terminal, run `sudo docker-compose up` - you should see the container come up, and start listening.
6. Then from the debug configurations choose to run 'dc-attach' - it attaches to port 5858
## Problem
Now - browse to http://localhost:3000 and the breakpoint does not get hit. This is probably because the actual work is now done in the children, listening on ports 5859, 5860, 5861, 5862.
## Question
How to get WebStorm's debugger to recognize this forking and attach itself to the right places?