dockerfile-rails 1.7.5 → 1.7.7

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: d70002b918b2110952ebace8ba264db76189fe7f5a27b1985313871e9318af8f
4
- data.tar.gz: 9cd5e7a99158113277978a9787cb099ba002d35d2dfaef2fba58d9abf1a67225
3
+ metadata.gz: 2e17b36ef8d027da87b7e6b8a956aec414dd6b3cae25f7defadbf5f37603cc53
4
+ data.tar.gz: e3b14e12a0e23b8b635e0aa23374e71f4ae83b4d87f2f67318fd8ad246d1a479
5
5
  SHA512:
6
- metadata.gz: 93bc70acc19970a2813bfcd9e56138dd3216ea6998e8a883cff27a305e8cd2a6694a750333249e1367eea05b37edccc2183f2a1d09b2fc1f8f65428d66f38af4
7
- data.tar.gz: 13f8868fbc6e5e09be03e3f323c9093e136b5b93d760d883d94057138f8e8c92ffd04841a5963a4c08175a011f03a44998ed7a396c2861da890ac4d3a6d8f001
6
+ metadata.gz: 7455998542f66e51f2d206832a2a6bf8785534d80a6e20ab801084b6e37e6ebde932510de69d3222c0bc13f244f388ed7031059c5206e149f62d9407fb5332b3
7
+ data.tar.gz: 7f915afac24acd50043103bac6cf3203abba39f28a727d686b4bd093cd580caeb6f0d9118708586a49ee1572b1361b21adbbd142276a32630bf9636b4d93c67a
data/README.md CHANGED
@@ -67,7 +67,7 @@ are actually using. But should you be using DATABASE_URL, for example, at runti
67
67
  additional support may be needed:
68
68
 
69
69
  * `--litefs` - use [LiteFS](https://fly.io/docs/litefs/)
70
- * `--litestream` - use [LiteFS](https://litestream.io/)
70
+ * `--litestream` - use [Litestream](https://litestream.io/)
71
71
  * `--mysql` - add mysql libraries
72
72
  * `--postgresql` - add postgresql libraries
73
73
  * `--redis` - add redis libraries
@@ -120,6 +120,16 @@ Options are saved between runs into `config/dockerfile.yml`. To invert a boolea
120
120
 
121
121
  ## Testing
122
122
 
123
+ Run:
124
+
125
+ Installation:
126
+
127
+ ```
128
+ brew install postgresql mysql zstd
129
+ bundle config --local build.mysql2 "--with-opt-dir="$(brew --prefix zstd)""
130
+ bundle install
131
+ ```
132
+
123
133
  A single invocation of `rake test:all` will run all of the tests defined. dockerfile-rails has are three types of tests:
124
134
 
125
135
  * `rake test:rubocop` runs [rubocop](https://github.com/rubocop/rubocop) using the same options as the Rails codebase.
@@ -43,23 +43,30 @@ module DockerfileRails
43
43
 
44
44
  ### database ###
45
45
 
46
+ # start by checkout config/database.yml. It defaults to sqlite3,
47
+ # but we can't rely on that because DATABASE_URL can override it.
48
+ # if we see anything else, assume the change was intentional.
46
49
  database = YAML.load_file("config/database.yml", aliases: true).
47
50
  dig("production", "adapter") rescue nil
48
51
 
49
- if database == "sqlite3"
50
- @sqlite3 = true
51
- elsif database == "postgresql"
52
+ if database == "postgresql"
52
53
  @postgresql = true
53
54
  elsif (database == "mysql") || (database == "mysql2") || (database == "trilogy")
54
55
  @mysql = true
55
56
  elsif database == "sqlserver"
56
57
  @sqlserver = true
57
- end
58
58
 
59
- @sqlite3 = true if @gemfile.include? "sqlite3"
60
- @postgresql = true if @gemfile.include? "pg"
61
- @mysql = true if @gemfile.include?("mysql2") || using_trilogy?
62
- @sqlserver = true if @gemfile.include?("activerecord-sqlserver-adapter")
59
+ ## if not found (or sqlite3), check the Gemfile
60
+ elsif @gemfile.include? "pg"
61
+ @postgresql = true
62
+ elsif @gemfile.include?("mysql2") || using_trilogy?
63
+ @mysql = true
64
+ elsif @gemfile.include?("activerecord-sqlserver-adapter")
65
+ @sqlserver = true
66
+ elsif @gemfile.include?("sqlite3") || database == "sqlite3"
67
+ # check this one last as sqlite3 may be used in development
68
+ @sqlite3 = true
69
+ end
63
70
 
64
71
  ### node modules ###
65
72
 
@@ -410,6 +410,13 @@ class DockerfileGenerator < Rails::Generators::Base
410
410
  missing = Set.new(base_packages + build_packages) -
411
411
  Set.new(dockerfile.scan(/[-\w]+/))
412
412
 
413
+ if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new("3.4.1")
414
+ # https://github.com/docker-library/ruby/pull/497
415
+ # https://github.com/rails/rails/pull/54237
416
+ missing.delete("libyaml-dev")
417
+ missing.delete("yaml-dev")
418
+ end
419
+
413
420
  unless missing.empty?
414
421
  message = "The following packages are missing from the Dockerfile: #{missing.to_a.join(", ")}"
415
422
  STDERR.puts "\n" + shell.set_color(message, Thor::Shell::Color::RED, Thor::Shell::Color::BOLD)
@@ -1164,11 +1171,11 @@ private
1164
1171
  else
1165
1172
  command = Shellwords.split(procfile.values.first)
1166
1173
 
1167
- if command.first == "./bin/thrust"
1168
- command[1..]
1169
- else
1170
- command
1171
- end
1174
+ thrust = command.index("./bin/thrust")
1175
+ thrust = command.index("litestream:run") if thrust.nil?
1176
+ command = command[thrust + 1...] unless thrust.nil?
1177
+
1178
+ command
1172
1179
  end
1173
1180
  end
1174
1181
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-31 00:00:00.000000000 Z
10
+ date: 2025-02-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubygems_version: 3.6.2
76
+ rubygems_version: 3.6.3
77
77
  specification_version: 4
78
78
  summary: Dockerfile generator for Rails
79
79
  test_files: []