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

前端 未结 5 1127
再見小時候
再見小時候 2021-02-02 10:22

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 machin

5条回答
  •  轮回少年
    2021-02-02 10:36

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

    • You can install node-inspector package inside your container: https://github.com/node-inspector/node-inspector
    • Map the port 8080 of your container on your host (run you container with parameter -p 8080:8080)
    • Run this inside your container (with docker exec, or docker-enter)

      node-debug --web-host 0.0.0.0 yourScript.js

    • Go to http://localhost:8080/debug?port=5858

提交回复
热议问题