# DAP Debugging Example # # Two-container setup for remote C++ debugging with Neovim DAP: # # "remote" – Alpine container running codelldb as a DAP server. # "devstation" – Alpine container with Neovim + LazyVim + nvim-dap. # # Usage: # docker compose build # docker compose up -d remote # start codelldb DAP server # docker compose run --rm devstation # interactive Neovim session # # Plugins, caches, and state persist in named volumes across runs, so # Neovim does not re-download plugins on every container start. # # Inside Neovim, open a source file (e.g. src/calculator.cpp), set a # breakpoint with db, then press dc and select # "Remote launch (codelldb remote:13000)". services: remote: build: context: . dockerfile: remote/Dockerfile ports: - "13000:13000" networks: - debug-net restart: unless-stopped # SYS_PTRACE + seccomp:unconfined let codelldb control the child # process (set breakpoints, read memory, single-step, etc.). cap_add: - SYS_PTRACE security_opt: - seccomp:unconfined devstation: build: context: . dockerfile: devstation/Dockerfile stdin_open: true tty: true working_dir: /project networks: - debug-net depends_on: - remote # Named volumes so Neovim plugins, caches, and state survive # container removal. Without these, every `docker compose run` # starts from scratch and re-downloads everything. volumes: - nvim-data:/home/dev/.local/share/nvim - nvim-state:/home/dev/.local/state/nvim - nvim-cache:/home/dev/.cache/nvim networks: debug-net: driver: bridge volumes: nvim-data: nvim-state: nvim-cache: