File tree Expand file tree Collapse file tree 4 files changed +17
-14
lines changed
Expand file tree Collapse file tree 4 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,9 @@ ARG ROOT=/usr/src/app/
22
33# available alpine packages: https://pkgs.alpinelinux.org/packages
44
5- FROM node:24-alpine AS asset-build
6- ARG ROOT
7- WORKDIR $ROOT
8- COPY package.json package-lock.json ./
9- RUN npm install --global npm@latest
10- RUN npm ci
11- COPY . .
12- RUN npm run build && npm run build:css
5+ FROM node:24-alpine AS node-source
136
14- FROM ruby:3.3.8-alpine AS rails- build
7+ FROM ruby:3.3.8-alpine AS build
158 ARG ROOT
169 WORKDIR $ROOT
1710
@@ -24,10 +17,17 @@ FROM ruby:3.3.8-alpine AS rails-build
2417 postgresql-dev \
2518 tzdata
2619
27-
2820 COPY Gemfile* $ROOT
2921 RUN bundle install
3022
23+ COPY --from=node-source /usr/local/bin/node /usr/local/bin/node
24+ COPY --from=node-source /usr/local/lib/node_modules /usr/local/lib/node_modules
25+ RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
26+ COPY package.json package-lock.json ./
27+ RUN npm ci --only=production --no-audit --no-fund
28+ COPY . .
29+ RUN ./bin/rails assets:precompile
30+
3131FROM ruby:3.3.8-alpine
3232 ARG ROOT
3333 WORKDIR $ROOT
@@ -42,9 +42,9 @@ FROM ruby:3.3.8-alpine
4242 vim \
4343 && rm -rf /var/cache/apk/*
4444
45- COPY . .
46- COPY --from=asset-build /usr/src/app/app/assets/builds ./app/assets/builds
47- COPY --from=rails- build /usr/local/bundle/ /usr/local/bundle/
45+ COPY --from=build $ROOT $ROOT
46+ RUN ls -la ./app
47+ COPY --from=build /usr/local/bundle/ /usr/local/bundle/
4848
4949 EXPOSE 3000
5050
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ gem "blueprinter" # for JSON serialization
1313gem "bugsnag" # tracking errors in prod
1414gem "caxlsx" , "~> 4.2" # excel spreadsheets - TODO can we remove this version restriction?
1515gem "caxlsx_rails" , "~> 0.6.4" # excel spreadsheets - TODO can we remove this version restriction?
16+ gem "cssbundling-rails" , "~> 1.4" # compiles css
1617gem "delayed_job_active_record"
1718gem "devise" # for authentication
1819gem "devise_invitable"
Original file line number Diff line number Diff line change 153153 bigdecimal
154154 rexml
155155 crass (1.0.6 )
156+ cssbundling-rails (1.4.3 )
157+ railties (>= 6.0.0 )
156158 csv (3.3.5 )
157159 database_cleaner-active_record (2.2.2 )
158160 activerecord (>= 5.a )
@@ -713,6 +715,7 @@ DEPENDENCIES
713715 capybara-screenshot
714716 caxlsx (~> 4.2 )
715717 caxlsx_rails (~> 0.6.4 )
718+ cssbundling-rails (~> 1.4 )
716719 database_cleaner-active_record
717720 delayed_job_active_record
718721 devise
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments