dockerfile-rails 1.6.20 → 1.6.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/dockerfile_generator.rb +21 -6
- metadata +3 -4
- data/lib/fly_replay.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d57f94bd7d0ee06690024d3a5beab4dc55bc02efcd8ccd390d5ba24e046cef2f
|
4
|
+
data.tar.gz: e6d155a91c132c60a214159668ba4998d20bbb5ad3192d852c4377eed43d72e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac80ebf094d7ac05106cbc7680a56452c5bca6c7d30c4a30ccb32f5e43042d50139e997a7866233c51d8c38234cf3568f06c4eafb2a3d281391a4379da256df4
|
7
|
+
data.tar.gz: 7bb349afdf55b80f8495c1034bc5b490fddc2488b110b219ffcb878f67c51c50720ec168340a72b3e5ec9854d4f97af77e3ed7ae23ae0e25d6678c901b75ea75
|
@@ -331,7 +331,10 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
331
331
|
|
332
332
|
template "docker-compose.yml.erb", "docker-compose.yml" if options.compose
|
333
333
|
|
334
|
-
|
334
|
+
if fix_database_config
|
335
|
+
template "database.yml.erb", "config/database.yml",
|
336
|
+
force: File.exist?("fly.toml")
|
337
|
+
end
|
335
338
|
|
336
339
|
if using_litefs?
|
337
340
|
template "litefs.yml.erb", "config/litefs.yml"
|
@@ -413,11 +416,23 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
413
416
|
STDERR.puts 'RUN sed -i "/net-pop (0.1.2)/a\ net-protocol" Gemfile.lock'
|
414
417
|
end
|
415
418
|
|
416
|
-
if
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
419
|
+
if File.exist?("fly.toml")
|
420
|
+
env = {}
|
421
|
+
|
422
|
+
if (options.sqlite3? || @sqlite3) && !dockerfile.include?("DATABASE_URL")
|
423
|
+
env["DATABASE_URL"] = "sqlite3:///data/production.sqlite3"
|
424
|
+
end
|
425
|
+
|
426
|
+
if using_thruster? && !dockerfile.include?("HTTP_PORT")
|
427
|
+
env["HTTP_PORT"] = "8080"
|
428
|
+
end
|
429
|
+
|
430
|
+
unless env.empty?
|
431
|
+
toml = IO.read("fly.toml")
|
432
|
+
if !toml.include?("[[env]]")
|
433
|
+
toml += "\n[[env]]\n" + env.map { |key, value| " #{key} = #{value.inspect}" }.join("\n")
|
434
|
+
File.write "fly.toml", toml
|
435
|
+
end
|
421
436
|
end
|
422
437
|
end
|
423
438
|
|
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.
|
4
|
+
version: 1.6.22
|
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-
|
11
|
+
date: 2024-09-30 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
|
@@ -76,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
75
|
- !ruby/object:Gem::Version
|
77
76
|
version: '0'
|
78
77
|
requirements: []
|
79
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.18
|
80
79
|
signing_key:
|
81
80
|
specification_version: 4
|
82
81
|
summary: Dockerfile generator for Rails
|
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
|