dockerfile-rails 1.6.22 → 1.6.24

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: d57f94bd7d0ee06690024d3a5beab4dc55bc02efcd8ccd390d5ba24e046cef2f
4
- data.tar.gz: e6d155a91c132c60a214159668ba4998d20bbb5ad3192d852c4377eed43d72e3
3
+ metadata.gz: 3d63730b1e3ff8ac7968202d2511f66b51f2faa890350ab71b7f553538aebaae
4
+ data.tar.gz: f5b546990dbdcc931c5cac7ace90c7219b2af280271c8650b82dc23a33f3ac76
5
5
  SHA512:
6
- metadata.gz: ac80ebf094d7ac05106cbc7680a56452c5bca6c7d30c4a30ccb32f5e43042d50139e997a7866233c51d8c38234cf3568f06c4eafb2a3d281391a4379da256df4
7
- data.tar.gz: 7bb349afdf55b80f8495c1034bc5b490fddc2488b110b219ffcb878f67c51c50720ec168340a72b3e5ec9854d4f97af77e3ed7ae23ae0e25d6678c901b75ea75
6
+ metadata.gz: be28e7ce7e16ea25334727debb71c212bf976fcc602863479ee9ea908849939a9e9ce3e6acbfbd5bfb1ae3c5d0d768c448f8bacfc321543a5fe9a8dd93a55634
7
+ data.tar.gz: 2e4236bcc182926d0667bc0ff69e24e3034985cce89c0a99690da808029a20d1a1e9bec982d15ed273b877bd374819d490feb76fe46a61478f2e7b98473de6b7
@@ -336,6 +336,10 @@ class DockerfileGenerator < Rails::Generators::Base
336
336
  force: File.exist?("fly.toml")
337
337
  end
338
338
 
339
+ if solidq_launcher == :puma && !File.read("config/puma.rb").include?(":solid_queue")
340
+ append_to_file "config/puma.rb", "\n# Run the Solid Queue's supervisor\nplugin :solid_queue\n"
341
+ end
342
+
339
343
  if using_litefs?
340
344
  template "litefs.yml.erb", "config/litefs.yml"
341
345
 
@@ -427,6 +431,10 @@ class DockerfileGenerator < Rails::Generators::Base
427
431
  env["HTTP_PORT"] = "8080"
428
432
  end
429
433
 
434
+ if solidq_launcher == :env && !dockerfile.include?("SOLID_QUEUE_IN_PUMA")
435
+ env["SOLID_QUEUE_IN_PUMA"] = "true"
436
+ end
437
+
430
438
  unless env.empty?
431
439
  toml = IO.read("fly.toml")
432
440
  if !toml.include?("[[env]]")
@@ -546,6 +554,22 @@ private
546
554
  @gemfile.include?("solid_queue") and includes_jobs?
547
555
  end
548
556
 
557
+ def solidq_launcher
558
+ if !using_solidq?
559
+ :none
560
+ elsif deploy_database != "sqlite3"
561
+ :process
562
+ elsif File.exist? "config/puma.rb"
563
+ if File.read("config/puma.rb").include?("SOLID_QUEUE_IN_PUMA")
564
+ File.exist?("fly.toml") ? :env : :none
565
+ else
566
+ :puma
567
+ end
568
+ else
569
+ :procfile
570
+ end
571
+ end
572
+
549
573
  def parallel?
550
574
  (using_node? || using_bun?) && options.parallel
551
575
  end
@@ -986,6 +1010,10 @@ private
986
1010
  env.merge! @@args["deploy"].to_h { |key, value| [key, "$#{key}"] }
987
1011
  end
988
1012
 
1013
+ if solidq_launcher == :env
1014
+ env["SOLID_QUEUE_IN_PUMA"] = "true"
1015
+ end
1016
+
989
1017
  env.merge! @@vars["deploy"] if @@vars["deploy"]
990
1018
 
991
1019
  env.map { |key, value| "#{key}=#{value.inspect}" }.sort
@@ -1212,23 +1240,29 @@ private
1212
1240
 
1213
1241
  def procfile
1214
1242
  if using_passenger?
1215
- {
1243
+ base = {
1216
1244
  nginx: "nginx"
1217
1245
  }
1218
1246
  elsif options.nginx?
1219
- {
1247
+ base = {
1220
1248
  nginx: '/usr/sbin/nginx -g "daemon off;"',
1221
1249
  rails: "./bin/rails server -p 3001"
1222
1250
  }
1223
1251
  elsif using_thruster?
1224
- {
1252
+ base = {
1225
1253
  rails: "bundle exec thrust ./bin/rails server"
1226
1254
  }
1227
1255
  else
1228
- {
1256
+ base = {
1229
1257
  rails: "./bin/rails server"
1230
1258
  }
1231
1259
  end
1260
+
1261
+ if solidq_launcher == :procfile
1262
+ base["solidq"] = "bundle exec rake solid_queue:start"
1263
+ end
1264
+
1265
+ base
1232
1266
  end
1233
1267
 
1234
1268
  def using_thruster?
@@ -1248,7 +1282,11 @@ private
1248
1282
  if using_sidekiq?
1249
1283
  list["sidekiq"] = "bundle exec sidekiq"
1250
1284
  elsif using_solidq?
1251
- list["solidq"] = "bundle exec rake solid_queue:start"
1285
+ if deploy_database == "sqlite3"
1286
+ return if list.size <= 1
1287
+ else
1288
+ list["solidq"] = "bundle exec rake solid_queue:start"
1289
+ end
1252
1290
  end
1253
1291
 
1254
1292
  list
@@ -1277,7 +1315,7 @@ private
1277
1315
  volumes = %w[ log storage ]
1278
1316
 
1279
1317
  if deploy_database == "sqlite3"
1280
- database = YAML.load_file("config/database.yml", aliases: true).dig("production", "database")
1318
+ database = YAML.load_file("config/database.yml", aliases: true).dig("production", "database") rescue nil
1281
1319
  if database && database =~ /^\w/
1282
1320
  volumes << File.dirname(database)
1283
1321
  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: 1.6.22
4
+ version: 1.6.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
11
+ date: 2024-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails