February 2019
Intermediate to advanced
240 pages
5h 25m
English
In development, by default, Rails compiles our assets for each request so that our changes are picked up automatically. However, typically in production, we precompile our assets once and then serve them up as static files for faster load times. Rails provides the following Rake task for this:
| | bin/rails assets:precompile |
Up until now, the changes we’ve needed to make for our app to run in production have just been config changes, or tweaks that would be fine in development too. Here, however, the production version of our app needs additional files: the compiled assets.
How do we achieve this with our Docker setup?
The solution is to create a second, production-flavored image that precompiles the assets ...
Read now
Unlock full access