#1521·hanami

Feature request: Support `--devcontainer` in `hanami new`

Author: unikitty37Created Apr 18, 2025Updated Apr 19, 2025

rails new supports the --devcontainer flag, which sets up the appropriate files for developing a Rails app in a VSCode devcontainer.

Hanami leaves you to your own devices; I've managed to get a devcontainer that works, as long as you type bundle install yourself each time you build it, but I've failed to get it to bundle automatically on rebuild (it keeps failing because rubocop installs prism, and ruby-lsp has already installed prism, and prism can't handle this gracefully as yet).

A search for "devcontainer" in the docs, and on discourse.hanamirb.org comes up with nothing. I haven't asked on Discourse as I don't really want to set up another account — and having Hanami able to set things up automatically will reduce friction for people wanting to switch from Rails. There's enough to learn without having to spend several hours just trying to get the development environment to work :)

Being able to have the devcontainer set up with a single flag would reduce friction and allow switchers to get on with actually learning Hanami.