Closed hovsater closed 10 months ago
Hi @kevinsjoberg, I've built something similar in the past and recently updated it. Is this something you wanted to build? https://github.com/meinac/rails-dev-docker-compose
@meinac tks!
for mac M1 users: we need use mariadb instead of mysql, because mysql docker image still not working in arm =/
I'm setting up rails-dev-box on a new M1 Macbook, and it seems like VirtualBox won't run on a non-AMD64 architecture.
This was easy to get around using the solution detailed here (I used Ubuntu 20.4 instead of 18.4, which ships with a more recent Ruby version): https://dev.to/taybenlor/running-vagrant-on-an-m1-apple-silicon-using-docker-3fh4
But unless there's an easy way to run VirtualBox on an M1 Mac, I think rails-dev-box needs to provide an alternate/universal dev environment. Migrating to Docker might make sense at this juncture.
I believe my Docker setup still works for all use cases. I could give it some love if there's an interest. 🙂
My idea with the dev environment was: You don't even need Ruby, and you don't need to pollute your computer with system dependencies for bundle install
to succeed: download, and ready.
It would be awesome to have the same experience with Docker Compose. Vagrant was the thing when I created this 10 years ago, but I believe nowadays people might feel more comfortable/familiar with Docker.
Both @meinac and @kevinsjoberg's projects feel like good starting points.
A few considerations:
Should services like memcached and redis live inside the rails container, or be defined separately in docker-compose.yml
? Note that activesupport/test/cache/stores/redis_cache_store_test.rb expects a redis endpoint of redis://localhost:6379/0
, whereas a standard docker setup might use redis://redis:6379/0
Should the rails container run on alpine or debian/bullseye? For debian, I think the current list of dependencies would be:
autoconf
default-mysql-client
ffmpeg
git
imagemagick
libncurses5-dev
libtool
libxml2
libxml2-dev
libxslt1-dev
libvips
memcached (or libmemcached-tools if running memcached as a separate service)
mupdf-tools
mupdf
nodejs
poppler-utils
postgresql-client
rabbitmq-server
redis (or redis-tools if running redis as a separate service)
sqlite3
yarn
Lastly, another approach here: https://github.com/yahonda/multipass-rails-dev-box
A Rails development environment based on Docker is now available as part of Rails (see https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#using-dev-container-cli).
Closing this issue because Rails provides Docker based Rails development environment. https://github.com/rails/rails-dev-box/issues/179#issuecomment-1887380114
Hey 👋 A while ago I opened https://github.com/rails/rails/pull/40216. It added an alternative development environment based on Docker. It got closed with the reason that they're not interested in maintaining that in the official repository.
Would it be of interested here? I'd be happy to port it over and maintain it for what it's worth. 🙂