improve dev setup#1085
Conversation
mortbauer
commented
Feb 5, 2025
- add doker build action
- add test worklflow running in docker buildx
- use multistage build
* add doker build action * add test worklflow running in docker buildx * use multistage build
There was a problem hiding this comment.
Thanks for the PR!
This is something for the current dev team to decide (I'm only a former maintainer). E.g. we already build container images on Docker Hub, so building it here is a bit superfluous.
Also, I'm not sure if I'd want to build a test image as part of the release workflow. I think passing RAILS_ENV as a variable is good, and then we could perhaps adapt the bundle install according to it (or even the --without argument value, defaulting to development test). Then the test workflow can use the same Dockerfile, but just run a different command (and if we'd need .rubocop files, we could mount them perhaps?)
I think this could be improved a bit more, e.g. precompiling assets in the build stage, then copying them to the dist. Invoking rubocop really belongs in the test workflow, not here (and I'd then also like to be able to run rspec using this image).
| RUN --mount=type=cache,target=/var/cache/apt/ \ | ||
| buildDeps='libmagic-dev mariadb-server nodejs' && \ | ||
| apt-get update && \ | ||
| apt-get install --no-install-recommends -y $buildDeps |
There was a problem hiding this comment.
This is happening in the base stage, so e.g. mariadb-server and the other buildDeps are getting into the final image (though I may be missing something). Even when removing in a later step, they'd be still in the layer.
|
maybe just for reference there was some time ago this attempt from me to build a multi-stage dockerfile, maybe you can reuse some ideas of that: #1021 |