dockerfile-rails 1.7.9 → 1.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e78cc232d1ab5de05f4fc57e07bc912d0523cb8d17b831fd4cb27a9852ae432
4
- data.tar.gz: 41560de52e9558d1f6a671ef03c5f13a8cf981be24f4ea3bc1ae7c2c38ddbe01
3
+ metadata.gz: c87e11cfc7094b0fc07aa8caf44a3fe9dd2eae917faf0f7dece4a63006230370
4
+ data.tar.gz: 9eea55358ddf5a993d5c5a315f33789f504628bb9839c67448df0a7068ccdeb2
5
5
  SHA512:
6
- metadata.gz: a4e026820a4cc3f46c7fece5a6702bbc1bc0bdd9a112a1c713e8ba9fb6977398efbbca33b0015f8db3e8dc22a9025f02c157f5994859632555012f933ccee1f5
7
- data.tar.gz: 344747d92ef3248dc42b9f180e2f8d0ce405da56a1a3f1a6650bb77e88235b1ef20cd0d20b804139d9167e929d589d6d464ce7e1e708b15418ccdbed6acc82e7
6
+ metadata.gz: da01082945921ddeebec9e437590e2c83801f9df5da6c6a8bf1b17906d0e97986dde1b008bbb794206f8fd5fbf45463ccbb887ea1d653f588047e641dbff4b41
7
+ data.tar.gz: 6e5d178956a067f785b494378dc00f4404c9af75fd74030754922aa8687e5779fa89c57f01d1a46caf1938cb04095ce7c3c0415f089a0b03402dcf90aa11b09d
data/README.md CHANGED
@@ -44,6 +44,7 @@ different contents. If both are specified, `--force` takes precedence.
44
44
 
45
45
  * `--cache` - use build caching to speed up builds
46
46
  * `--parallel` - use multi-stage builds to install gems and node modules in parallel
47
+ * `--nproc n` - run bundle install in parallel
47
48
 
48
49
  ### Add/remove a Feature:
49
50
 
@@ -27,6 +27,7 @@ class DockerfileGenerator < Rails::Generators::Base
27
27
  "mysql" => false,
28
28
  "nginx" => false,
29
29
  "parallel" => false,
30
+ "nproc" => 1,
30
31
  "passenger" => false,
31
32
  "platform" => nil,
32
33
  "postgresql" => false,
@@ -148,6 +149,9 @@ class DockerfileGenerator < Rails::Generators::Base
148
149
  class_option :parallel, type: :boolean, default: OPTION_DEFAULTS.parallel,
149
150
  desc: "use build stages to install gems and node modules in parallel"
150
151
 
152
+ class_option :nproc, type: :numeric, default: OPTION_DEFAULTS.nproc,
153
+ desc: "run bundle install in parallel"
154
+
151
155
  class_option :swap, type: :string, default: OPTION_DEFAULTS.swap,
152
156
  desc: "allocate swapspace"
153
157
 
@@ -96,6 +96,9 @@ ENV <%= build_env.join(" \\\n ") %>
96
96
  <% end -%>
97
97
  # Install application gems
98
98
  COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %><%= ruby_version_file %> <% end %>./
99
+ <% if options.nproc > 1 -%>
100
+ ENV MAKE="make -j<%= options.nproc %>"
101
+ <% end -%>
99
102
  <% if @netpopbug && Rails.env != "test" -%>
100
103
  RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock
101
104
  <% end -%>
@@ -5,7 +5,7 @@ COPY<% if options.link? %> --link<% end %> .yarn/releases/* .yarn/releases/
5
5
  <% end -%>
6
6
  <% if using_bun? -%>
7
7
  RUN <% if options.cache? %>--mount=type=cache,id=bld-bun-cache,target=/root/.bun \
8
- <% end %>bun install<% if options.lock? %> --frozen-lockfile<% end %>
8
+ <% end %>bun install<% if options.lock? %> --frozen-lockfile<% end %> --production
9
9
  <% elsif sources.join.include? 'yarn' -%>
10
10
  RUN <% if options.cache? %>--mount=type=cache,id=bld-yarn-cache,target=/root/.yarn \
11
11
  YARN_CACHE_FOLDER=/root/.yarn <% end %>yarn install<% if options.lock? %> --<% if yarn_version < '2' -%>frozen-lockfile<% else %>immutable<% end %><% end %>
@@ -40,7 +40,7 @@ services:
40
40
  <% end -%>
41
41
  <% end -%>
42
42
  secrets:
43
- - source: master_key
43
+ - source: RAILS_MASTER_KEY
44
44
  target: /rails/config/master.key
45
45
  <% if using_redis? or deploy_database != 'sqlite3' -%>
46
46
  depends_on:
@@ -135,5 +135,5 @@ secrets:
135
135
  <% end -%>
136
136
 
137
137
  secrets:
138
- master_key:
139
- file: ./config/master.key
138
+ RAILS_MASTER_KEY
139
+ file: ./config/master.key
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  LITESTREAM_CONFIG = ENV["LITESTREAM_CONFIG"] || Rails.root.join("tmp/litestream.yml").to_s
2
3
 
3
4
  LITESTREAM_TEMPLATE = <<-EOF
@@ -36,7 +37,7 @@ namespace :litestream do
36
37
  end
37
38
 
38
39
  @dbs.each do |db|
39
- next if File.exist?(db) or !ENV["BUCKET_NAME"]
40
+ next if File.exist?(db) || !ENV["BUCKET_NAME"]
40
41
  system "litestream restore -config #{LITESTREAM_CONFIG} -if-replica-exists #{db}"
41
42
  exit $?.exitstatus unless $?.exitstatus == 0
42
43
  end
@@ -45,8 +46,12 @@ namespace :litestream do
45
46
  task :run do
46
47
  require "shellwords"
47
48
 
48
- exec(*%w[bundle exec litestream replicate -config],
49
- LITESTREAM_CONFIG, "-exec", Shellwords.join(ARGV[1..-1]))
49
+ if ENV["BUCKET_NAME"]
50
+ exec(*%w[bundle exec litestream replicate -config],
51
+ LITESTREAM_CONFIG, "-exec", Shellwords.join(ARGV[1..]))
52
+ else
53
+ exec(*ARGV[1..])
54
+ end
50
55
  end
51
56
  end
52
57
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.9
4
+ version: 1.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.6.3
76
+ rubygems_version: 3.6.9
77
77
  specification_version: 4
78
78
  summary: Dockerfile generator for Rails
79
79
  test_files: []