1

I have a Docker container running a Django Back-End server in the URL: 127.0.0.1:7080, this is, the port where the container is running is 7080 and the Django local project was linked with the project inside the Docker container using a docker volume.

My question is: Is there a method to debug the local project with the python congfiguration inside the Docker container? I think that maybe I should configure the launch.json file.

I hope someone could resolve me this issue.

There's some configuration code inside the launch.json file.

{
            "name": "Python: Remote Attach",
            "type": "python",
            "request": "attach",
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "/usr/src/app/"
                }
            ],
            "port": 7080,
            "host": "127.0.0.1"
        },

1 Answer 1

1

Consider using the "Remote - Containers" extension so you can develop within the container itself. https://code.visualstudio.com/docs/remote/containers has detailed instructions.

Sign up to request clarification or add additional context in comments.

2 Comments

@Jean-FrançoisFabre I didn't get notifications about the removals and I was catching up on unanswered questions after vacation, so I'm not sure which other ones you removed. As for flagging comments of moderators, your initial comment came off a rather brusque and short with me, hence the flag. I do appreciate the edit you made.
Well, I deleted this one and another duplicate/very similar one: stackoverflow.com/a/57998740/6451573. I'm cleaning up other comments now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.