You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.7 KiB
63 lines
1.7 KiB
# 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 <leader>db, then press <leader>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:
|
|
|