dockerfile-rails 1.6.0 → 1.6.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cadc12073c9a21acfbcab9778dc9864d967779f16a1be4bcfd1f23acf43e203d
|
4
|
+
data.tar.gz: 7dd17c1a575c438b3adaa9d1c6e506a48fcb8ca901c69019e51576d0de419537
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14760dcac1784800f19ee67e8dc77642f1e5872b27bd7b8628e41fd7d1815e09094191e6ed4b691372199dd04144a87fcef75f5770e8379dd2d223292cf7fd28
|
7
|
+
data.tar.gz: 9fd1234b3cf3ac61e55710c64a26595f043401252a17753f0f39d9676251ea5092b37239ede5cf1d1eb5950ef91503dbf02448e032823241289f4ac4df76e504
|
data/README.md
CHANGED
@@ -99,15 +99,15 @@ Args and environment variables can be tailored to a specific build phase by addi
|
|
99
99
|
|
100
100
|
### Advanced Customization:
|
101
101
|
|
102
|
-
There may be times where feature detection plus flags just aren't enough. As an example, you may wish to configure and run multiple processes.
|
102
|
+
There may be times where feature detection plus flags just aren't enough. As an example, you may wish to configure and run multiple processes.
|
103
103
|
|
104
|
-
* `--instructions=path` - a dockerfile fragment to be inserted into the final document.
|
104
|
+
* `--instructions=path` - a dockerfile fragment to be inserted into the final document.
|
105
105
|
* `--migration=cmd` - a replacement (generally a script) for `db:prepare`/`db:migrate`.
|
106
106
|
* `--procfile=path` - a [Procfile](https://github.com/ddollar/foreman#foreman) to use in place of launching Rails directly.
|
107
107
|
|
108
108
|
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`.
|
109
109
|
|
110
|
-
|
110
|
+
Additionally, if the instructions start with a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) instead the file being treated as a Dockerfile fragment, the file is treated as a script and a `RUN` statement is added to your Dockerfile instead.
|
111
111
|
|
112
112
|
---
|
113
113
|
|
@@ -65,6 +65,7 @@ class DockerfileGenerator < Rails::Generators::Base
|
|
65
65
|
"libmagickwand-dev" => "imagemagick-libs",
|
66
66
|
"libsqlite3-0" => "sqlite-dev",
|
67
67
|
"libtiff-dev" => "tiff-dev",
|
68
|
+
"libjemalloc2" => "jemalloc",
|
68
69
|
"libvips" => "vips-dev",
|
69
70
|
"node-gyp" => "gyp",
|
70
71
|
"pkg-config" => "pkgconfig",
|
@@ -415,7 +416,8 @@ private
|
|
415
416
|
|
416
417
|
def using_node?
|
417
418
|
return @using_node if @using_node != nil
|
418
|
-
|
419
|
+
return if using_bun?
|
420
|
+
@using_node = File.exist?("package.json")
|
419
421
|
end
|
420
422
|
|
421
423
|
def using_bun?
|
@@ -423,6 +425,10 @@ private
|
|
423
425
|
@using_bun = File.exist?("bun.config.js") || File.exist?("bun.lockb")
|
424
426
|
end
|
425
427
|
|
428
|
+
def references_ruby_version_file?
|
429
|
+
@references_ruby_version_file ||= IO.read("Gemfile").include?(".ruby-version")
|
430
|
+
end
|
431
|
+
|
426
432
|
def using_redis?
|
427
433
|
# Note: If you have redis installed on your computer, 'rails new` will
|
428
434
|
# automatically add redis to your Gemfile, so having it in your Gemfile is
|
@@ -454,8 +460,12 @@ private
|
|
454
460
|
@gemfile.include?("sidekiq")
|
455
461
|
end
|
456
462
|
|
463
|
+
def using_solidq?
|
464
|
+
@gemfile.include?("solid_queue")
|
465
|
+
end
|
466
|
+
|
457
467
|
def parallel?
|
458
|
-
using_node? && options.parallel
|
468
|
+
(using_node? || using_bun?) && options.parallel
|
459
469
|
end
|
460
470
|
|
461
471
|
def has_mysql_gem?
|
@@ -597,6 +607,7 @@ private
|
|
597
607
|
packages = %w(build-essential)
|
598
608
|
packages += @@packages["build"] if @@packages["build"]
|
599
609
|
packages += %w(nodejs npm) if (node_version == "lts") && (not using_execjs?)
|
610
|
+
packages << "libyaml-dev" if options.fullstaq?
|
600
611
|
|
601
612
|
# add databases: sqlite3, postgres, mysql
|
602
613
|
packages << "pkg-config" if options.sqlite3? || @sqlite3
|
@@ -622,7 +633,6 @@ private
|
|
622
633
|
|
623
634
|
unless using_execjs? || using_puppeteer?
|
624
635
|
packages << "curl"
|
625
|
-
packages << "unzip" if using_bun?
|
626
636
|
end
|
627
637
|
|
628
638
|
# module build process depends on Python, and debian changed
|
@@ -647,6 +657,10 @@ private
|
|
647
657
|
end
|
648
658
|
end
|
649
659
|
|
660
|
+
if using_bun?
|
661
|
+
packages += %w(curl unzip)
|
662
|
+
end
|
663
|
+
|
650
664
|
if options.alpine?
|
651
665
|
alpinize(packages)
|
652
666
|
else
|
@@ -1121,7 +1135,7 @@ private
|
|
1121
1135
|
|
1122
1136
|
def fly_processes
|
1123
1137
|
return unless File.exist? "fly.toml"
|
1124
|
-
return unless using_sidekiq?
|
1138
|
+
return unless using_sidekiq? || using_solidq?
|
1125
1139
|
|
1126
1140
|
if procfile.size > 1
|
1127
1141
|
list = { "app" => "foreman start --procfile=Procfile.prod" }
|
@@ -1129,7 +1143,11 @@ private
|
|
1129
1143
|
list = { "app" => procfile.values.first }
|
1130
1144
|
end
|
1131
1145
|
|
1132
|
-
|
1146
|
+
if using_sidekiq?
|
1147
|
+
list["sidekiq"] = "bundle exec sidekiq"
|
1148
|
+
elsif using_solidq?
|
1149
|
+
list["solidq"] = "bundle exec rake solid_queue:start"
|
1150
|
+
end
|
1133
1151
|
|
1134
1152
|
list
|
1135
1153
|
end
|
@@ -8,7 +8,7 @@ ARG RUBY_VERSION=<%= RUBY_VERSION %>
|
|
8
8
|
|
9
9
|
<% end -%>
|
10
10
|
<% if options.fullstaq -%>
|
11
|
-
FROM <%= platform %>quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-<%= options.jemalloc ? 'jemalloc-' : '' %><%= variant %><% unless options.precompile == "defer" %> as base<% end %>
|
11
|
+
FROM <%= platform %>quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-<%= options.jemalloc ? 'jemalloc-' : 'malloctrim-' %><%= variant %><% unless options.precompile == "defer" %> as base<% end %>
|
12
12
|
<% else -%>
|
13
13
|
FROM <%= platform %><%= options.registry %>ruby:$RUBY_VERSION-<%= variant %><% unless options.precompile == "defer" %> as base<% end %>
|
14
14
|
<% end -%>
|
@@ -86,7 +86,7 @@ ENV <%= build_env.join(" \\\n ") %>
|
|
86
86
|
|
87
87
|
<% end -%>
|
88
88
|
# Install application gems
|
89
|
-
COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock
|
89
|
+
COPY<% if options.link? %> --link<% end %> Gemfile Gemfile.lock <% if references_ruby_version_file? %>.ruby-version <% end %>./
|
90
90
|
<% if options.alpine? and deploy_packages.include? 'sqlite-libs' -%>
|
91
91
|
# Workaround sqlite/alpine issue: https://github.com/sparklemotion/sqlite3-ruby/issues/434
|
92
92
|
RUN bundle config force_ruby_platform true && \
|
@@ -143,7 +143,7 @@ COPY --from=node /usr/local/node /usr/local/node
|
|
143
143
|
ENV PATH=/usr/local/node/bin:$PATH
|
144
144
|
<% end -%>
|
145
145
|
|
146
|
-
<% elsif using_node? -%>
|
146
|
+
<% elsif using_node? || using_bun? -%>
|
147
147
|
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb)]} %>
|
148
148
|
|
149
149
|
<% end -%>
|
@@ -90,11 +90,15 @@ services:
|
|
90
90
|
redis-db:
|
91
91
|
image: redis
|
92
92
|
<% end -%>
|
93
|
-
<% if using_sidekiq? and deploy_database != 'sqlite3' -%>
|
93
|
+
<% if (using_sidekiq? or using_solidq?) and deploy_database != 'sqlite3' -%>
|
94
94
|
|
95
|
-
sidekiq:
|
95
|
+
<%= using_sidekiq? ? "sidekiq" : "solidq" %>:
|
96
96
|
build: .
|
97
|
+
<% if using_sidekiq? -%>
|
97
98
|
command: bundle exec sidekiq
|
99
|
+
<% else -%>
|
100
|
+
command: bundle exec rake solid_queue:start
|
101
|
+
<% end -%>
|
98
102
|
environment:
|
99
103
|
- RAILS_MASTER_KEY=$RAILS_MASTER_KEY
|
100
104
|
- REDIS_URL=redis://redis-db:6379
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-06 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.4.
|
77
|
+
rubygems_version: 3.4.8
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Dockerfile generator for Rails
|