VSCode Debug

Flask application

Install debugpy in your Dockerfile

RUN pip install debugpy

Run the debug server

python3 -m debugpy --listen 0.0.0.0:5679 run.py

Expose debug port

docker run -p 1337:1337 -p 5679:5679 --rm --name=cop -it cop

launch.json (.vscode)

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Attach to Container",
            "type": "python",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5679
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}/challenge",
                    "remoteRoot": "/app"
                }
            ]
        }
    ]
}

NodeJS application

Run with debug server

Expose debug port

launch.json (.vscode)

Last updated