dockerfile-rails 0.4.6 → 0.4.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a58947d6c45936ce561ae3ddfdd3799773d17c5145fb15ae8013c9b293b53ce1
4
- data.tar.gz: 0a9aff0df9a5e4688d47fa40fe151f6aabe4cdc8f5010c0e5e5514bd0d013fc8
3
+ metadata.gz: e9b601d4f4e8ba2476ebdc5a721aa605f605b54b36cd2ebda0d8959035ed6621
4
+ data.tar.gz: 8f87d53ade0657596d6b0915c1523b477d213684019dfb66fd48949a86568186
5
5
  SHA512:
6
- metadata.gz: 44675c3dbac8f26938a990209e821a2974bd330c4ee1ab7a1cf59316ae2a622ed0cfb03ccf0bf6dfe5f776d200dff31ce789c0840c407fcd6fa64c96e88c4d89
7
- data.tar.gz: 9f37b005a98f99c06d724c25afd61a50cb0d1e3c63391fd252b8a7179493b78624b1dd2ae70df45fedd5b92405f99a44bfc6b980369f194e8caa15d66d79bdaf
6
+ metadata.gz: cfe3dc014ee68c023c65c8dfe1716ba9d05ac6266bf0b1ef478f73968c974be78303d9b108ef91e475cf81fd9398185d46ee4b13ebb9435ca15357db31a71c8a
7
+ data.tar.gz: 25124c64efc2e59bdd00e608c72758ea6996655051f15cf85242b99311c0d04f700d98c13d936d5e752516eaf58f777964c5e113b0203606a7f0a535e6082ccf
@@ -235,18 +235,22 @@ private
235
235
 
236
236
  def yarn_version
237
237
  package = JSON.parse(IO.read('package.json'))
238
- if package['packageManager'].to_s.start_with? "yarn@"
238
+
239
+ if ENV['RAILS_ENV'] == 'test'
240
+ # yarn install instructions changed in v2
241
+ version = '1.22.19'
242
+ elsif package['packageManager'].to_s.start_with? "yarn@"
239
243
  version = package['packageManager'].sub('yarn@', '')
240
244
  else
241
- version = `yarn --version`[/\d+\.\d+\.\d+/]
245
+ version = `yarn --version`[/\d+\.\d+\.\d+/] || '1.22.19'
242
246
  system "yarn set version #{version}"
243
-
244
- # apparently not all versions of yarn will update package.json
245
247
  package = JSON.parse(IO.read('package.json'))
246
- unless package['packageManager']
247
- package['packageManager'] = "yarn@#{version}"
248
- IO.write('package.json', JSON.pretty_generate(package))
249
- end
248
+ # apparently not all versions of yarn will update package.json...
249
+ end
250
+
251
+ unless package['packageManager']
252
+ package['packageManager'] = "yarn@#{version}"
253
+ IO.write('package.json', JSON.pretty_generate(package))
250
254
  end
251
255
 
252
256
  version
@@ -70,14 +70,16 @@ RUN --mount=type=cache,id=bld-gem-cache,sharing=locked,target=/srv/vendor \
70
70
  mkdir -p vendor && \
71
71
  bundle config set path vendor && \
72
72
  cp -ar /srv/vendor .
73
+
73
74
  <% else -%>
74
75
  RUN bundle _${BUNDLER_VERSION}_ install<% if depend_on_bootsnap? -%> && \
75
- bundle exec bootsnap precompile --gemfile
76
- <% end -%>
77
- <% end -%>
76
+ bundle exec bootsnap precompile --gemfile<% end %>
78
77
 
78
+ <% end -%>
79
79
  <% if parallel? -%>
80
- asdf
80
+ # Copy node modules
81
+ COPY --from=node /rails/node_modules /rails/node_modules
82
+
81
83
  <% elsif using_node? -%>
82
84
  <%= render partial: 'npm_install', locals: {sources: %w(package.json yarn.lock)} %>
83
85
 
@@ -95,7 +97,7 @@ RUN bundle exec bootsnap precompile app/ lib/
95
97
  <%= "RUN " + binfile_fixups.join(" && \\\n ") %>
96
98
 
97
99
  <% end -%>
98
- <% if Dir.exist?('assets') and !api_only? -%>
100
+ <% if Dir.exist?('app/assets') and !api_only? -%>
99
101
  # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
100
102
  RUN SECRET_KEY_BASE<%= Rails::VERSION::MAJOR<7 || Rails::VERSION::STRING.start_with?('7.0') ? '=DUMMY' : '_DUMMY=1' %> ./bin/rails assets:precompile
101
103
 
@@ -17,5 +17,14 @@ RUN curl -fsSL https://fnm.vercel.app/install | bash && \
17
17
  ENV PATH=/root/.local/share/fnm/aliases/default/bin/:$PATH
18
18
  <% end -%>
19
19
  <% if yarn_version -%>
20
+ <% if yarn_version < '2' -%>
20
21
  RUN npm install -g yarn@$YARN_VERSION
22
+ <% else -%>
23
+ <% if (node_version.split('.').map(&:to_i) <=> [16,10,0]) < 0 -%>
24
+ RUN npm i -g corepack && \
25
+ <% else -%>
26
+ RUN corepack enable && \
27
+ <% end -%>
28
+ corepack prepare yarn@$YARN_VERSION --activate
29
+ <% end -%>
21
30
  <% end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-21 00:00:00.000000000 Z
11
+ date: 2023-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails