I’ve been working out what my ideal development environment set up process is, and since I love docker, I like to have everything for the development environment work with a simple ‘docker compose up’, maybe with a --build option thrown on there.
I had hopes when I saw the getting_started_with_devcontainer guide, but ultimately it disappoints me that I still have to download and manage an executable service on my device with rails-new.
Futhermore, I like the idea of having an option to initialize a development environment dockerfile designed to be agnostic development environment, as opposed to the whole devcontainer.json stuff. It should generate a development dockerfile (in addition to the production ready one) with a sensible minimalistic default setup with some comments for common development niceties.
I apologize if I seem to be missing the point of the guide/dockerization goals going on for rails; I don’t mean to criticize the devcontainer way, I just want a no dependency way as well.
As for my thoughts on resolving the initialization aspect of the matter, I’ve decided to use this to initialize rails apps myself. Only requiring docker (and a linux kernel for it to run on).
docker run --rm --volume ${PWD}:/app --workdir /app --user $(id -u):$(id -g) ruby:latest bash -c "gem install rails && rails new myapp --database=postgresql"
It might need to be refined a bit, but I think we should probably make a no setup way to quickly get a rails project running without having to configure our local machine.