rails-new
rails-new copied to clipboard
[proposal] Add node and yarn installation logic to dockerfile
This PR addresses issue #22
Currently our Dockerfile image doesn't have node and yarn binaries which results in errors when using --js or --css switches.
This PR adds logic for downloading node 22.7.0 binary and installing yarn 1.22.22 to our dockerfiles. It also bumps default ruby to 3.3.5 and default rails to 7.2.1
How this was tested?
> cargo build
> ./target/debug/rails-new main --js esbuild --css tailwind
> docker run -it --rm -v $(pwd)/main:/rails -w /rails -p 3000:3000 -e BINDING=0.0.0.0 rails-new-3.3.5-7.2.1 /bin/bash -c "bundle install && ./bin/dev"
> visited http://localhost:3000 and confirmed that page is live
> docker run -it --rm rails-new-3.3.5-7.2.1 bash
root@ac7b091459cb:/# ruby --version
ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
root@ac7b091459cb:/# rails --version
Rails 7.2.1
root@ac7b091459cb:/# node --version
v22.7.0
root@ac7b091459cb:/# yarn --version
1.22.22
@rafaelfranca, @excid3 let me know what do you think, I'm open to rewritting this PR to your prefered approach