Skip to content

Add Vagrant+Docker DAP attach template#7

Open
body-clock wants to merge 1 commit intomainfrom
issue-4-vagrant
Open

Add Vagrant+Docker DAP attach template#7
body-clock wants to merge 1 commit intomainfrom
issue-4-vagrant

Conversation

@body-clock
Copy link
Copy Markdown
Owner

Summary

Adds templates/vagrant-project.nvim.lua — copy to any Vagrant+Docker Rails project root as .nvim.lua to enable remote DAP attach from the host.

The template configures nvim-dap to connect over TCP to a ruby/debug server forwarded through both the Docker container and Vagrant VM port forwarding. Required infrastructure changes are documented as comments in the file.

Depends on: #5 (nvim-dap must be installed)

Infrastructure setup (per project, one-time)

docker-compose.yml

ports:
  - "12345:12345"
environment:
  RUBY_DEBUG_OPEN: "1"
  RUBY_DEBUG_PORT: "12345"
  RUBY_DEBUG_HOST: "0.0.0.0"

Vagrantfile

config.vm.network "forwarded_port", guest: 12345, host: 12345

Workflow

  1. Start Rails in container (debug env vars set)
  2. Hit binding.b — execution pauses, rdbg waits for DAP connection
  3. <leader>dc → "Attach to rdbg (Vagrant+Docker)" → dap-ui opens on host

Closes #4

🤖 Generated with Claude Code

Adds templates/vagrant-project.nvim.lua as a drop-in .nvim.lua for
Rails projects running inside Vagrant+Docker. Configures nvim-dap to
attach over TCP to a ruby/debug server exposed through port forwarding.
Includes the required docker-compose and Vagrantfile changes as comments.

Closes #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugging Rails in Vagrant+Docker: connect neovim on host to running container

1 participant