dockerfile-rails 1.6.22 → 1.6.23

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: d57f94bd7d0ee06690024d3a5beab4dc55bc02efcd8ccd390d5ba24e046cef2f
4
- data.tar.gz: e6d155a91c132c60a214159668ba4998d20bbb5ad3192d852c4377eed43d72e3
3
+ metadata.gz: 470ee4a04d8cdca1cb340ac2c1b72bf5948900e50ad7a500e496ea8659e7b848
4
+ data.tar.gz: 16cc734ca04cb5e3c514135b130880ff1abf373ae4a415692aafdf723b5e6458
5
5
  SHA512:
6
- metadata.gz: ac80ebf094d7ac05106cbc7680a56452c5bca6c7d30c4a30ccb32f5e43042d50139e997a7866233c51d8c38234cf3568f06c4eafb2a3d281391a4379da256df4
7
- data.tar.gz: 7bb349afdf55b80f8495c1034bc5b490fddc2488b110b219ffcb878f67c51c50720ec168340a72b3e5ec9854d4f97af77e3ed7ae23ae0e25d6678c901b75ea75
6
+ metadata.gz: c3d1dd01ab68286af66e8ab402dbb1e2d5b47a4d1841608d6a5d343bb9c3940b8cafe0e94439ee7621caa658deb70742a79bcb47c1cda2770360f7f674aaf8f2
7
+ data.tar.gz: 546c4a4f92b78779b0595f98588f1a7b9394c4329ba0eb0b5ab1b86d2e37656d87aeac9d4881a3bcd325e3985ab75784503884831e79e38c5e61aa5026e30983
data/lib/fly_replay.rb ADDED
@@ -0,0 +1,29 @@
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
@@ -336,6 +336,10 @@ 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")
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
 
@@ -1248,7 +1252,11 @@ private
1248
1252
  if using_sidekiq?
1249
1253
  list["sidekiq"] = "bundle exec sidekiq"
1250
1254
  elsif using_solidq?
1251
- list["solidq"] = "bundle exec rake solid_queue:start"
1255
+ if deploy_database == "sqlite3"
1256
+ return if list.size <= 1
1257
+ else
1258
+ list["solidq"] = "bundle exec rake solid_queue:start"
1259
+ end
1252
1260
  end
1253
1261
 
1254
1262
  list
@@ -1277,7 +1285,7 @@ private
1277
1285
  volumes = %w[ log storage ]
1278
1286
 
1279
1287
  if deploy_database == "sqlite3"
1280
- database = YAML.load_file("config/database.yml", aliases: true).dig("production", "database")
1288
+ database = YAML.load_file("config/database.yml", aliases: true).dig("production", "database") rescue nil
1281
1289
  if database && database =~ /^\w/
1282
1290
  volumes << File.dirname(database)
1283
1291
  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.23
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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,6 +37,7 @@ files:
37
37
  - Rakefile
38
38
  - lib/dockerfile-rails.rb
39
39
  - lib/dockerfile-rails/scanner.rb
40
+ - lib/fly_replay.rb
40
41
  - lib/generators/dockerfile_generator.rb
41
42
  - lib/generators/templates/Dockerfile.erb
42
43
  - lib/generators/templates/_apt_install.erb