dockerfile-rails 1.6.1 → 1.6.2

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: 563c6043b8c8890edd114a6fe77b543dc745a43e18f59585ae945dbbe9a31bb2
4
- data.tar.gz: 16ebea3a573d36330c4b38105d3d49391b7ca751f737298bda61bd70c41df35d
3
+ metadata.gz: cadc12073c9a21acfbcab9778dc9864d967779f16a1be4bcfd1f23acf43e203d
4
+ data.tar.gz: 7dd17c1a575c438b3adaa9d1c6e506a48fcb8ca901c69019e51576d0de419537
5
5
  SHA512:
6
- metadata.gz: 62bed853707b519c58e8e242cf7b3a0011f82fcd4523799ce35942e2d960df750483c8cf9f40face14c1cb356d6852cc117559afb903b5acebd4f0e5d637fbf1
7
- data.tar.gz: d0029262a06767acebfbf93b5cc46d46550098191167733717eba7f23e4e9631fe6cac13651bb1cbff2a4197a7114f457ccea56a99f9535e5b7e9a82699fe24d
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
- Additionaly, 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.
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",
@@ -424,6 +425,10 @@ private
424
425
  @using_bun = File.exist?("bun.config.js") || File.exist?("bun.lockb")
425
426
  end
426
427
 
428
+ def references_ruby_version_file?
429
+ @references_ruby_version_file ||= IO.read("Gemfile").include?(".ruby-version")
430
+ end
431
+
427
432
  def using_redis?
428
433
  # Note: If you have redis installed on your computer, 'rails new` will
429
434
  # automatically add redis to your Gemfile, so having it in your Gemfile is
@@ -455,6 +460,10 @@ private
455
460
  @gemfile.include?("sidekiq")
456
461
  end
457
462
 
463
+ def using_solidq?
464
+ @gemfile.include?("solid_queue")
465
+ end
466
+
458
467
  def parallel?
459
468
  (using_node? || using_bun?) && options.parallel
460
469
  end
@@ -598,6 +607,7 @@ private
598
607
  packages = %w(build-essential)
599
608
  packages += @@packages["build"] if @@packages["build"]
600
609
  packages += %w(nodejs npm) if (node_version == "lts") && (not using_execjs?)
610
+ packages << "libyaml-dev" if options.fullstaq?
601
611
 
602
612
  # add databases: sqlite3, postgres, mysql
603
613
  packages << "pkg-config" if options.sqlite3? || @sqlite3
@@ -1125,7 +1135,7 @@ private
1125
1135
 
1126
1136
  def fly_processes
1127
1137
  return unless File.exist? "fly.toml"
1128
- return unless using_sidekiq?
1138
+ return unless using_sidekiq? || using_solidq?
1129
1139
 
1130
1140
  if procfile.size > 1
1131
1141
  list = { "app" => "foreman start --procfile=Procfile.prod" }
@@ -1133,7 +1143,11 @@ private
1133
1143
  list = { "app" => procfile.values.first }
1134
1144
  end
1135
1145
 
1136
- list["sidekiq"] = "bundle exec sidekiq"
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
1137
1151
 
1138
1152
  list
1139
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 && \
@@ -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.1
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: 2023-12-21 00:00:00.000000000 Z
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.10
77
+ rubygems_version: 3.4.8
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Dockerfile generator for Rails