A Production Image
Learn about the changes we need for a production image.
Precompiling assets
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 have 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, ...