dockerfile-rails 1.6.20 → 1.6.21
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: b937cd3cb1aac852332cec69d74844548ec84a2a891cf46effd2a1e8ebbbba39
|
4
|
+
data.tar.gz: e4038b8e3c87c7ff294d1272c4ff5bd2f59fd0247ab9f5da860994baf50fbbd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7af874f91e9b92a374f628cb822e5513827a65511631b5c9678c90183dd33f252037cb03e02ef20c5b121014ad09413088da73969b6d8ca2bb88e6d2791417d5
|
7
|
+
data.tar.gz: c600be2fcc77d4228ffa6d8acc3e5d3ce342576be8f4f986bc3e0fbe4022f2f9f3911c5be83c3e96548c3445680f830837cbe230c663cc16d72f94758f9541ce
|
@@ -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.21
|
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
|