dockerfile-rails 1.6.11 → 1.6.12

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: 38dcdef2aee6ee5c058a39c20f94dd1a786cebd4ae13b73c04ce105af60b1227
4
- data.tar.gz: 491eb04d414d7a97268eddb82d5637997cd6bafe84ff8ae04c5c859ffbf62353
3
+ metadata.gz: 2166500bf8ebbd97df50dec8e206c6233414fb6310a9369693664fa662927acc
4
+ data.tar.gz: 751a16215549914f56b91330b5c8168916efe276dc290090ea44ca357d6af66c
5
5
  SHA512:
6
- metadata.gz: 9404ac27ff75311447320c4a0092a11dda3bd82fb7db8b369ccbb65efb7f291b445ea3d8867c8247baad9fb2efbe8f7aa9437c1a02529add19bdf416b4f5ff8c
7
- data.tar.gz: 0703e28305e99057211826a13ba2d8992d52238fbaeb4b71e10a29ab2f3f130ae7efc91248f663bb1e4215b1b0bc484bcf05a6ad0a1842f93d76b3fce229ca76
6
+ metadata.gz: 32fff3700db3dc21809587ea403e7f8c4ba8fd8ba30321b4f5489419f15b853680dd6ad941b02c17aa0d632451e10a390f9d24f36389cc0a1766019f7a4fcc29
7
+ data.tar.gz: 8cc6ca30994f5837c9d9728f3c1ee1a0f232fdbc439f345e7827c404e613f46c119a2a2e370f908bba8feb747c9d3a0cbcf55f8f6742657fcc68948823504d5d
data/README.md CHANGED
@@ -97,6 +97,7 @@ Args and environment variables can be tailored to a specific build phase by addi
97
97
  * `--root` - run application as root
98
98
  * `--windows` - make Dockerfile work for Windows users that may have set `git config --global core.autocrlf true`
99
99
  * `--private-gemserver-domain=gems.example.com` - set the domain name of your private gemserver. This is used to tell bundler for what domain to use the credentials of a private gemserver provided via a docker secret
100
+ * `--no-precompiled-gems` - compile all gems instead of using precompiled versions
100
101
 
101
102
  ### Advanced Customization:
102
103
 
@@ -106,6 +107,7 @@ There may be times where feature detection plus flags just aren't enough. As an
106
107
  * `--migrate=cmd` - a replacement (generally a script) for `db:prepare`/`db:migrate`.
107
108
  * `--no-gemfile-updates` - do not modify my gemfile.
108
109
  * `--procfile=path` - a [Procfile](https://github.com/ddollar/foreman#foreman) to use in place of launching Rails directly.
110
+ * `--registry=another.docker.registry.com` - use a different registry for sourcing Docker images (e.g. public.ecr.aws).
109
111
 
110
112
  Like with environment variables, packages, and build args, `--instructions` can be tailored to a specific build phase by adding `-base`, `-build`, or `-deploy` after the flag name, with the default being `-deploy`.
111
113
 
@@ -29,6 +29,7 @@ class DockerfileGenerator < Rails::Generators::Base
29
29
  "platform" => nil,
30
30
  "postgresql" => false,
31
31
  "precompile" => nil,
32
+ "precompiled-gems" => true,
32
33
  "prepare" => true,
33
34
  "private-gemserver-domain" => nil,
34
35
  "procfile" => "",
@@ -124,6 +125,9 @@ class DockerfileGenerator < Rails::Generators::Base
124
125
  class_option :precompile, type: :string, default: OPTION_DEFAULTS.precompile,
125
126
  desc: 'if set to "defer", assets:precompile will be done at deploy time'
126
127
 
128
+ class_option "precompiled-gems", type: :boolean, default: OPTION_DEFAULTS["precompiled-gems"],
129
+ desc: "use precompiled gems"
130
+
127
131
  class_option "bin-cd", type: :boolean, default: OPTION_DEFAULTS["bin-cd"],
128
132
  desc: "modify binstubs to set working directory"
129
133
 
@@ -223,7 +227,6 @@ class DockerfileGenerator < Rails::Generators::Base
223
227
  class_option "gemfile-updates", type: :boolean, default: OPTION_DEFAULTS["gemfile-updates"],
224
228
  desc: "include gemfile updates"
225
229
 
226
-
227
230
  class_option "add-base", type: :array, default: [],
228
231
  desc: "additional packages to install for both build and deploy"
229
232
 
@@ -113,7 +113,7 @@ RUN --mount=type=secret,id=gemserver_credentials,target=/kaniko/gemserver_creden
113
113
  bundle install<% if depend_on_bootsnap? && options.precompile != "defer" -%> && \
114
114
  bundle exec bootsnap precompile --gemfile<% end %> && \
115
115
  <% else -%>
116
- RUN bundle install<% if depend_on_bootsnap? && options.precompile != "defer" -%> && \
116
+ RUN <% if options["precompiled-gems"] != true %>bundle config set force_ruby_platform true && \<%= "\n " %><% end %>bundle install<% if depend_on_bootsnap? && options.precompile != "defer" -%> && \
117
117
  bundle exec bootsnap precompile --gemfile<% end %> && \
118
118
  <% end -%>
119
119
  rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
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.11
4
+ version: 1.6.12
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-08 00:00:00.000000000 Z
11
+ date: 2024-05-13 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