FROM base-builder as modules-builder COPY --from=bundle-builder /app/Gemfile /app/Gemfile.lock ./ COPY --from=yarn-builder /app/package.json /app/yarn.lock ./ FROM modules-builder as assets-builder ... COPY ./app/assets /app/app/assets RUN bundle exec rails assets:precompile FROM modules-builder as webpack-builder ... COPY frontend ./frontend RUN yarn run webpack --config config/webpack/production.js
... FROM base-builder as bundle-builder COPY Gemfile Gemfile.lock ./ RUN bundle install -j4 --without development test deployment FROM base-builder as yarn-builder COPY package.json yarn.lock ./ RUN yarn install --production --frozen-lockfile
... FROM base-builder as bundle-builder COPY Gemfile Gemfile.lock ./ RUN --mount=type=cache,target=/app/tmp \ bundle install --path=/app/tmp/bundle -j4 --without development test deployment FROM base-builder as yarn-builder COPY package.json yarn.lock ./ RUN --mount=type=cache,target=/app/tmp \ --mount=type=cache,target=/usr/local/share/.cache/yarn \ yarn install --modules-folder=/app/tmp/node_modules --production --frozen-lockfile