I’ve been trying to get Debugpy working with Nvim-DAP from inside a Docker container. I think I am close, but it’s not really working yet.
I perform these steps:
- Open the
runtime/service.pyfile in Neovim for editing.
docker compose up --buildto:
./runtimeas a “volume” in the container
2.2. Start Debugpy, which starts Hypercorn, which starts the web server
2.3. Expose the ports for Debugpy (9001) and the Uvicorn web server (8001) on my system
:lua require('dap').continue()to start a session, and select 1 for my “Generic remote” adapter.
- Open the Nvim-DAP REPL with
It appears that Neovim is successfully starting a “session” that is connected to the Debugpy server inside the container. I can set breakpoints with
:lua require('dap').toggle_breakpoint() and see the “B” sign appear in the sign column.
My Python program appears to run just fine. I can make requests with
curl http://localhost:8001/, getting the correct responses and seeing the expected log output.
However I can’t seem to actually drop into the debugger at all, no matter if I set a breakpoint or I manually trigger an exception. Manually inserting a
breakpoint() call just triggers a
BdbQuit exception as you might expect.
Is there something I’m missing in the setup here?
- Nvim-DAP at commit
- Docker 20.10.5, build
55c4c88with Docker Desktop for Mac
- MacOS 10.14.6