This repository is an example of how to run a Node.js program in debug mode from Docker with live reload enabled.
There are two different ways for debugging your Node.js apps.
Using only your terminal using the properties below on your docker-compose:
nodejs-debug-docker:
stdin_open: true
command: npm run debug:terminal
...
After that you'd run docker-compose run nodejs-debug-docker
which will enter in the interactive mode.
You can also run a few commands such as:
list(20)
to show the first 10 lines of code.sb(19)
to set a breakpoint on the 19th line.c
to continue the execution after setting the break point.- You'd run
curl "localhost:3000?number1=10&number2=20"
to get your debugger working exec calculation
you can see the current value stored oncalculation
variabler
to restart and so on.
Following this repository, you'd run docker-compose up --build
then you'd go to your browser, open your inpection menu
(using F12
) then you'd see your app there