I\'ve just registered for this question. It\'s about if it\'s possible to remote debug python code in a Docker Container with VS Code. I am having a completely configured Docker
Yes, this is possible - when the Python app is running in a Docker container, you can treat it like a remote machine.
In your Docker image, you'll need to make the remote debugging port available (e.g. EXPOSE 3000
in the Dockerfile), include the ptvsd
setup in your Python app, and then publish the port when you run the container, something like:
docker run -d -p 3000:3000 my-image
Then use docker inspect
to get the IP address of the running container, and that's what you use for the host
in the launch file.