Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

improve dev setup #1085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mortbauer
Copy link
Contributor

  • 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
Copy link
Member

@wvengen wvengen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +20 to +23
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
Copy link
Member

@wvengen wvengen Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yksflip
Copy link
Member

yksflip commented Feb 6, 2025

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants