4 ms·
It's intended. Yes serving static files from Ruby is slower than from nginx or whatever, but you'd need to embed nginx in the image and run both processes etc.
by byroot 4y ago
It's intended. Yes serving static files from Ruby is slower than from nginx or whatever, but you'd need to embed nginx in the image and run both processes etc.
The assumption here is that there is a caching proxy in front of the container, so Rails will only serve each assets once, so performance isn't critical.
- jrochkind1 4y agoI am not sure which they intended, but the problem is that the comment doesn't match the code: > RAILS_SERVE_STATIC_FILES="true" > RAILS_SERVE_STATIC_FILES - This instructs Rails to not serve static files That is not what it does when you put `="true"`, nope. In fact both, settings are common. On heroku you typically use `RAILS_SERVE_STATIC_FILES="true"` but put a CDN in front. But other people do false and have eg nginx serving them. If this is what fly.io means you to do... where is the nginx, not mentioned in the tutorial? Whichever they intend to do, their code does not match their narrative of what it does.
- byroot 4y agoI was answering to the person saying to open a PR (on Rails I presume). That comment isn't in the Rails dockerfile, it was added by the OP. https://github.com/rails/rails/blob/4f3af4a67f227ed7998fed570b9aa671e1b74117/railties/lib/rails/generators/rails/app/templates/Dockerfile.tt#L28 https://github.com/rails/rails/blob/4f3af4a67f227ed7998fed57...