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 14, 2024
1 parent 309063b commit 4e8a523
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ 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
# rm -rf /var/cache/apk/*

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 +30,11 @@ 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 $RAILS_ROOT $RAILS_ROOT
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/

EXPOSE 3000
Expand Down

0 comments on commit 4e8a523

Please sign in to comment.