Skip to content

Commit

Permalink
add docker target for rubocoop
Browse files Browse the repository at this point in the history
  • Loading branch information
mortbauer committed Feb 21, 2024
1 parent fec11f6 commit 382c6e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ RUN --mount=type=cache,target=/usr/local/bundle/ \
/etc/init.d/mariadb stop && \
cp -r /usr/local/bundle /bundle

FROM builder as dev

RUN gem install rubocop-rails rubocop-rspec rubocop-capybara rubocop-factory_bot


FROM builder as app
COPY --from=compiler /bundle /usr/local/bundle
COPY --from=compiler /usr/src/app/public /usr/src/app/public
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ IMAGE_NAME=foodsoft
IMAGE_TAG:=latest

image-dev:
docker buildx build --tag ${IMAGE_NAME}:${IMAGE_TAG} --progress=plain --target=builder .
docker buildx build --tag ${IMAGE_NAME}-rubocop:${IMAGE_TAG} --progress=plain --target=dev .

image-prod:
docker buildx build --tag ${IMAGE_NAME}:${IMAGE_TAG} --no-cache --progress=plain --target=app .

image-prod-dev:
docker buildx build --tag ${IMAGE_NAME}:${IMAGE_TAG} --progress=plain --target=app .

rubocop:
docker run --rm -it -v ${PWD}:/work:ro --workdir /work foodsoft-rubocop bash

0 comments on commit 382c6e4

Please sign in to comment.