dockerfile-rails 1.6.23 → 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: 470ee4a04d8cdca1cb340ac2c1b72bf5948900e50ad7a500e496ea8659e7b848
4
- data.tar.gz: 16cc734ca04cb5e3c514135b130880ff1abf373ae4a415692aafdf723b5e6458
3
+ metadata.gz: 3d63730b1e3ff8ac7968202d2511f66b51f2faa890350ab71b7f553538aebaae
4
+ data.tar.gz: f5b546990dbdcc931c5cac7ace90c7219b2af280271c8650b82dc23a33f3ac76
5
5
  SHA512:
6
- metadata.gz: c3d1dd01ab68286af66e8ab402dbb1e2d5b47a4d1841608d6a5d343bb9c3940b8cafe0e94439ee7621caa658deb70742a79bcb47c1cda2770360f7f674aaf8f2
7
- data.tar.gz: 546c4a4f92b78779b0595f98588f1a7b9394c4329ba0eb0b5ab1b86d2e37656d87aeac9d4881a3bcd325e3985ab75784503884831e79e38c5e61aa5026e30983
6
+ metadata.gz: be28e7ce7e16ea25334727debb71c212bf976fcc602863479ee9ea908849939a9e9ce3e6acbfbd5bfb1ae3c5d0d768c448f8bacfc321543a5fe9a8dd93a55634
7
+ data.tar.gz: 2e4236bcc182926d0667bc0ff69e24e3034985cce89c0a99690da808029a20d1a1e9bec982d15ed273b877bd374819d490feb76fe46a61478f2e7b98473de6b7
@@ -336,7 +336,7 @@ class DockerfileGenerator < Rails::Generators::Base
336
336
  force: File.exist?("fly.toml")
337
337
  end
338
338
 
339
- if using_solidq? && deploy_database == "sqlite3" && File.exist?("config/puma.rb")
339
+ if solidq_launcher == :puma && !File.read("config/puma.rb").include?(":solid_queue")
340
340
  append_to_file "config/puma.rb", "\n# Run the Solid Queue's supervisor\nplugin :solid_queue\n"
341
341
  end
342
342
 
@@ -431,6 +431,10 @@ class DockerfileGenerator < Rails::Generators::Base
431
431
  env["HTTP_PORT"] = "8080"
432
432
  end
433
433
 
434
+ if solidq_launcher == :env && !dockerfile.include?("SOLID_QUEUE_IN_PUMA")
435
+ env["SOLID_QUEUE_IN_PUMA"] = "true"
436
+ end
437
+
434
438
  unless env.empty?
435
439
  toml = IO.read("fly.toml")
436
440
  if !toml.include?("[[env]]")
@@ -550,6 +554,22 @@ private
550
554
  @gemfile.include?("solid_queue") and includes_jobs?
551
555
  end
552
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
+
553
573
  def parallel?
554
574
  (using_node? || using_bun?) && options.parallel
555
575
  end
@@ -990,6 +1010,10 @@ private
990
1010
  env.merge! @@args["deploy"].to_h { |key, value| [key, "$#{key}"] }
991
1011
  end
992
1012
 
1013
+ if solidq_launcher == :env
1014
+ env["SOLID_QUEUE_IN_PUMA"] = "true"
1015
+ end
1016
+
993
1017
  env.merge! @@vars["deploy"] if @@vars["deploy"]
994
1018
 
995
1019
  env.map { |key, value| "#{key}=#{value.inspect}" }.sort
@@ -1216,23 +1240,29 @@ private
1216
1240
 
1217
1241
  def procfile
1218
1242
  if using_passenger?
1219
- {
1243
+ base = {
1220
1244
  nginx: "nginx"
1221
1245
  }
1222
1246
  elsif options.nginx?
1223
- {
1247
+ base = {
1224
1248
  nginx: '/usr/sbin/nginx -g "daemon off;"',
1225
1249
  rails: "./bin/rails server -p 3001"
1226
1250
  }
1227
1251
  elsif using_thruster?
1228
- {
1252
+ base = {
1229
1253
  rails: "bundle exec thrust ./bin/rails server"
1230
1254
  }
1231
1255
  else
1232
- {
1256
+ base = {
1233
1257
  rails: "./bin/rails server"
1234
1258
  }
1235
1259
  end
1260
+
1261
+ if solidq_launcher == :procfile
1262
+ base["solidq"] = "bundle exec rake solid_queue:start"
1263
+ end
1264
+
1265
+ base
1236
1266
  end
1237
1267
 
1238
1268
  def using_thruster?
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.23
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-11-02 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
@@ -37,7 +37,6 @@ files:
37
37
  - Rakefile
38
38
  - lib/dockerfile-rails.rb
39
39
  - lib/dockerfile-rails/scanner.rb
40
- - lib/fly_replay.rb
41
40
  - lib/generators/dockerfile_generator.rb
42
41
  - lib/generators/templates/Dockerfile.erb
43
42
  - lib/generators/templates/_apt_install.erb
data/lib/fly_replay.rb DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Fly
4
- class FlyReplay
5
- def initialize(app)
6
- @app = app
7
- end
8
-
9
- def call(env)
10
- # replay /prometheus/* to the prom proxy in bubblegum
11
- if env["PATH_INFO"].starts_with?("/prometheus")
12
- return [307, { "Fly-Replay" => "app=flyio-bubblegum-api" }, []]
13
- end
14
-
15
- # replay /debug to the debug app. unsure if this is actually used
16
- if env["PATH_INFO"].starts_with?("/debug")
17
- return [307, { "Fly-Replay" => "app=debug" }, []]
18
- end
19
-
20
- @status, @headers, @response = @app.call(env)
21
-
22
- context = OpenTelemetry::Trace.current_span.context
23
- @headers["fly-trace-id"] = context.trace_id.unpack1("H*")
24
- @headers["fly-span-id"] = context.span_id.unpack1("H*")
25
-
26
- [@status, @headers, @response]
27
- end
28
- end
29
- end