dockerfile-rails 1.7.5 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -1
- data/lib/dockerfile-rails/scanner.rb +15 -8
- data/lib/generators/dockerfile_generator.rb +12 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e17b36ef8d027da87b7e6b8a956aec414dd6b3cae25f7defadbf5f37603cc53
|
4
|
+
data.tar.gz: e3b14e12a0e23b8b635e0aa23374e71f4ae83b4d87f2f67318fd8ad246d1a479
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 [
|
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 == "
|
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
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
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.
|
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-
|
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.
|
76
|
+
rubygems_version: 3.6.3
|
77
77
|
specification_version: 4
|
78
78
|
summary: Dockerfile generator for Rails
|
79
79
|
test_files: []
|