'How to attach VS CODE nodejs debugger into docker image?

I am developing in docker image.

I can run my script in docker using: docker exec -it mydocker node index.js.

How can I attach vs code debugger into script running in docker image?

I don't know how to write launch.json configuration



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source