nickjj / docker-rails-example

A production ready example Rails app that's using Docker and Docker Compose.
MIT License
941 stars 185 forks source link

Update Node to 20.X #63

Closed travisdock closed 10 months ago

travisdock commented 10 months ago

Hey Nick, Maybe you were keeping the version on 18 for a reason but I thought I would open this PR to see what your thoughts were.

And another quick question if you have a second. Why don't you install gems locally and mount them to the container so that whenever you rebuild your container you are not installing all of them every time?

travisdock commented 10 months ago

Also, thank you for all your content! I am loving it!

nickjj commented 10 months ago

Hi,

Back when using Webpack instead of esbuild updating Node LTS versions didn't always work out but now with esbuild it should be pretty safe to update.

Can you also update the CHANGELOG.md to include this change in the languages and services section? That section doesn't exist yet for this release, but it would look like this:

## [Unreleased]

### Changed

- ...

#### Languages and services

- Update `Node` to `20.X`

#### Back-end dependencies

- ...

And then amend the git commit message to be Update Node 18 to 20? Then we can merge this.

As for installing gems locally, that would mean having a fully working Ruby environment in your local environment which partially removes some of the benefits of Docker. Currently gems only get installed on build if your Gemfile changes or you change something above that line in the Dockerfile. I do think it's annoying that all gems get reinstalled when you update 1 gem, there's not a huge amount you can do here while keeping things fully self contained to Docker.

travisdock commented 10 months ago

Done!

My apologies, I didn't explain very well in my gems question. I meant to install from within the docker ruby environment but set the install path to a mounted folder. Let me see if I can create an example and I will open a new merge request or issue to show you.

nickjj commented 10 months ago

Thanks for the PR!

Yep, a volume mount works at the cost of mounting a lot of files back to your host.