Skip to content

Commit

Permalink
balance yarn and bundle installs
Browse files Browse the repository at this point in the history
  • Loading branch information
FireLemons committed Aug 16, 2024
1 parent 7e0f934 commit b32b710
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@ FROM ruby:3.2.2-alpine AS builder
RUN apk update && apk upgrade && apk add --update --no-cache \
build-base \
curl-dev \
nodejs \
postgresql-dev \
tzdata \
vim \
yarn && rm -rf /var/cache/apk/*
tzdata

ARG RAILS_ROOT=/usr/src/app/
WORKDIR $RAILS_ROOT

COPY package*.json yarn.lock $RAILS_ROOT
RUN yarn install --check-files

COPY Gemfile* $RAILS_ROOT
RUN bundle install

COPY . .
RUN yarn build && yarn build:css

### BUILD STEP DONE ###

FROM ruby:3.2.2-alpine
Expand All @@ -38,7 +29,10 @@ RUN apk update && apk upgrade && apk add --update --no-cache \

WORKDIR $RAILS_ROOT

COPY --from=builder $RAILS_ROOT $RAILS_ROOT
COPY . .
RUN yarn install
RUN yarn build && yarn build:css

COPY --from=builder /usr/local/bundle/ /usr/local/bundle/

EXPOSE 3000
Expand Down

0 comments on commit b32b710

Please sign in to comment.