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"
        },
Fragoso
  • 11
  • 1

1 Answers1

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.

Brett Cannon
  • 14,438
  • 3
  • 45
  • 40
  • @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. – Brett Cannon Sep 23 '19 at 23:52
  • Well, I deleted this one and another duplicate/very similar one: https://stackoverflow.com/a/57998740/6451573. I'm cleaning up other comments now. – Jean-François Fabre Sep 24 '19 at 06:02