dockerfile-rails 1.6.12 → 1.6.13

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: 2166500bf8ebbd97df50dec8e206c6233414fb6310a9369693664fa662927acc
4
- data.tar.gz: 751a16215549914f56b91330b5c8168916efe276dc290090ea44ca357d6af66c
3
+ metadata.gz: 6e248008553d63dc5b088dadfa1e79620d4f2db08f67bd67506a5f8a0421b973
4
+ data.tar.gz: de2ded8ae1828b7db4812fc9082928c9d4d57caf3ed4aa965134c2dec76dcb83
5
5
  SHA512:
6
- metadata.gz: 32fff3700db3dc21809587ea403e7f8c4ba8fd8ba30321b4f5489419f15b853680dd6ad941b02c17aa0d632451e10a390f9d24f36389cc0a1766019f7a4fcc29
7
- data.tar.gz: 8cc6ca30994f5837c9d9728f3c1ee1a0f232fdbc439f345e7827c404e613f46c119a2a2e370f908bba8feb747c9d3a0cbcf55f8f6742657fcc68948823504d5d
6
+ metadata.gz: 8763575bc2a8d064e2ee20d3f6add987d81fede3656ba1f8c8b38c0f6808c8448ca31ca4e362ddac9bf275c38c10cb6baf0bbd113a842726623cff7a63b379c1
7
+ data.tar.gz: f54366d61f5f18d0db311922c5acae95950c5e56d6b56d262a93486c0019e29ac88744035d670eded6a2a08353a24c1a1f4093fdea38ba61a439322373c8dc22
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
@@ -1169,7 +1169,7 @@ private
1169
1169
  nginx: '/usr/sbin/nginx -g "daemon off;"',
1170
1170
  rails: "./bin/rails server -p 3001"
1171
1171
  }
1172
- elsif options.thruster? || @gemfile.include?("thruster")
1172
+ elsif using_thruster?
1173
1173
  {
1174
1174
  rails: "bundle exec thrust ./bin/rails server"
1175
1175
  }
@@ -1180,6 +1180,10 @@ private
1180
1180
  end
1181
1181
  end
1182
1182
 
1183
+ def using_thruster?
1184
+ options.thruster? || @gemfile.include?("thruster")
1185
+ end
1186
+
1183
1187
  def fly_processes
1184
1188
  return unless File.exist? "fly.toml"
1185
1189
  return unless using_sidekiq? || using_solidq?
@@ -296,7 +296,7 @@ EOF
296
296
 
297
297
  <% end -%>
298
298
  # Start the server by default, this can be overwritten at runtime
299
- EXPOSE 3000
299
+ EXPOSE <%= using_thruster? ? '80' : '3000' %>
300
300
  <% if deploy_database == 'sqlite3' -%>
301
301
  VOLUME /data
302
302
  <% 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.12
4
+ version: 1.6.13
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-05-13 00:00:00.000000000 Z
11
+ date: 2024-05-16 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