To your point I think there is a better solution than what I've provided in this article. I should be using a multistage build. If I were building dev.to on a container for production I'd probably have a build pipeline for each commit that would do something like:
build a ruby image based off .ruby-version file
build a dependency image from the ruby image off the gemfile/yarnfile
build an image with compiled assets
add in the app code
The only time all the build steps get run is when the ruby-version is updated, otherwise the build uses the cache (assuming docker is able to cache i.e. the build is not running in ephemeral infrastructure). In the normal case where the app code is changing but the dependencies are not only the last step is executed which should be relatively quick.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To your point I think there is a better solution than what I've provided in this article. I should be using a multistage build. If I were building dev.to on a container for production I'd probably have a build pipeline for each commit that would do something like:
The only time all the build steps get run is when the ruby-version is updated, otherwise the build uses the cache (assuming docker is able to cache i.e. the build is not running in ephemeral infrastructure). In the normal case where the app code is changing but the dependencies are not only the last step is executed which should be relatively quick.