Skip to content

Commit a0899bd

Browse files
committed
temp
1 parent 67fd7d4 commit a0899bd

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff 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+
3131
FROM 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

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ gem "blueprinter" # for JSON serialization
1313
gem "bugsnag" # tracking errors in prod
1414
gem "caxlsx", "~> 4.2" # excel spreadsheets - TODO can we remove this version restriction?
1515
gem "caxlsx_rails", "~> 0.6.4" # excel spreadsheets - TODO can we remove this version restriction?
16+
gem "cssbundling-rails", "~> 1.4" # compiles css
1617
gem "delayed_job_active_record"
1718
gem "devise" # for authentication
1819
gem "devise_invitable"

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ GEM
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

lib/tasks/disable_jsbundling_rails_from_calling_node.rake

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)