File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11ARG ROOT=/usr/src/app/
22
3- FROM ruby:3.3.8-alpine AS builder
3+ # available alpine packages: https://pkgs.alpinelinux.org/packages
4+
5+ FROM node:24-alpine AS node-source
6+
7+ FROM ruby:3.3.8-alpine AS build
48 ARG ROOT
59 WORKDIR $ROOT
610
@@ -13,17 +17,13 @@ FROM ruby:3.3.8-alpine AS builder
1317 postgresql-dev \
1418 tzdata
1519
16-
1720 COPY Gemfile* $ROOT
1821 RUN bundle install
1922
2023FROM ruby:3.3.8-alpine
2124 ARG ROOT
2225 WORKDIR $ROOT
2326
24- RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ nodejs=24.13.0-r2 npm
25-
26- # available: https://pkgs.alpinelinux.org/packages
2727 RUN apk update && apk upgrade && apk add --update --no-cache \
2828 bash \
2929 build-base \
@@ -35,11 +35,12 @@ FROM ruby:3.3.8-alpine
3535 && rm -rf /var/cache/apk/*
3636
3737 COPY . .
38- RUN npm install --global npm@latest
39- RUN npm install
40- RUN npm run build && npm run build:css
38+ COPY --from=node-source /usr/local/bin/node /usr/local/bin/node
39+ COPY --from=node-source /usr/local/lib/node_modules /usr/local/lib/node_modules
40+ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
41+ RUN npm ci
4142
42- COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
43+ COPY --from=build /usr/local/bundle/ /usr/local/bundle/
4344
4445 EXPOSE 3000
4546
You can’t perform that action at this time.
0 commit comments