dockerfile-rails 1.6.12 → 1.6.14

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: 2531120f4d41adf0dd6616bd2402b96236bbe88d29bb4ce68540807fe90ee9d7
4
+ data.tar.gz: 6ce1bd73ea9ff3d999c11e8c0e22f00b4ed3324f5cca1b811b147a101ca9988a
5
5
  SHA512:
6
- metadata.gz: 32fff3700db3dc21809587ea403e7f8c4ba8fd8ba30321b4f5489419f15b853680dd6ad941b02c17aa0d632451e10a390f9d24f36389cc0a1766019f7a4fcc29
7
- data.tar.gz: 8cc6ca30994f5837c9d9728f3c1ee1a0f232fdbc439f345e7827c404e613f46c119a2a2e370f908bba8feb747c9d3a0cbcf55f8f6742657fcc68948823504d5d
6
+ metadata.gz: 300bf0e817f27b0f4972333d87bbe1b322c866e8e3eeaf5eb4bd689f69a584b992ecdf9c5d93299130cef292bf3666a637f353658a744593ef7e32b3f381f7fd
7
+ data.tar.gz: c71043dc03cea93277164bc4ad4aa4e37712b76df6c40f65883bead0a8503f125f3a5f904c594ce8b6d26873a86fbee6b11deb2f0f58bc6daa2a1d9c106f514b
@@ -372,7 +372,8 @@ class DockerfileGenerator < Rails::Generators::Base
372
372
  remove_file "config/dockerfile.yml"
373
373
  end
374
374
 
375
- # check Dockerfile for common errors: missing packages, mismatched Ruby version
375
+ # check Dockerfile for common errors: missing packages, mismatched Ruby version;
376
+ # also add DATABASE_URL to fly.toml if needed
376
377
  if options.skip? && File.exist?("Dockerfile")
377
378
  message = nil
378
379
  shell = Thor::Base.shell.new
@@ -393,6 +394,14 @@ class DockerfileGenerator < Rails::Generators::Base
393
394
  STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
394
395
  end
395
396
 
397
+ if (options.sqlite3? || @sqlite3) && !dockerfile.include?("DATABASE_URL") && File.exist?("fly.toml")
398
+ toml = IO.read("fly.toml")
399
+ if !toml.include?("[[env]]")
400
+ toml += "\n[[env]]\n DATABASE_URL = \"sqlite3:///data/production.sqlite3\"\n"
401
+ File.write "fly.toml", toml
402
+ end
403
+ end
404
+
396
405
  exit 42 if message
397
406
  end
398
407
  end
@@ -1169,7 +1178,7 @@ private
1169
1178
  nginx: '/usr/sbin/nginx -g "daemon off;"',
1170
1179
  rails: "./bin/rails server -p 3001"
1171
1180
  }
1172
- elsif options.thruster? || @gemfile.include?("thruster")
1181
+ elsif using_thruster?
1173
1182
  {
1174
1183
  rails: "bundle exec thrust ./bin/rails server"
1175
1184
  }
@@ -1180,6 +1189,10 @@ private
1180
1189
  end
1181
1190
  end
1182
1191
 
1192
+ def using_thruster?
1193
+ options.thruster? || @gemfile.include?("thruster")
1194
+ end
1195
+
1183
1196
  def fly_processes
1184
1197
  return unless File.exist? "fly.toml"
1185
1198
  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.14
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-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 3.5.9
77
+ rubygems_version: 3.5.10
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Dockerfile generator for Rails