dockerfile-rails 0.3.2 → 0.4.0

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: 6d9ad7d1afb7766ab99f26cebe531e5242c0e1b045965f8b1b08cdb7d3048b4e
4
- data.tar.gz: bce09d700333e1bb6cc3a80d9abcdfede0cbd3fb48157c0655342ea89bb68643
3
+ metadata.gz: 438d7f814f08f6180930a72f8b2e6437cb3b53b45ff495d99a0e5abf5c85e361
4
+ data.tar.gz: 71d21d72fc2aea9062fa9ba15e491083d279caa050f264e36de424a42e70ef44
5
5
  SHA512:
6
- metadata.gz: 452a96a35af88b08aca8229ff52be8ebc37712da48ec2b17f5b3ab8147c7901e0ee344698d209c9cd515fd984dfc652d188a01718a3853b00d790cc9bb9ed7f2
7
- data.tar.gz: 7b11087072696ef3aae63f895e8680ed048d60500f3d6947319c2ffa47254b9af6a02c7f63584ccf6782affb88e198d2d16eb438703c6cc85d023427b280a1f7
6
+ metadata.gz: eb59c4587e1f9b0b9dbd93b7e71e49a2211659bb3e8c9c9a58919f39b3d30963a41b954ad182c418c19df2edabbf68578494bce069306bc1947c18af1fcf1c7a
7
+ data.tar.gz: d3c30f95c8f17c44e1f4bc09639ed67a246e6d3b10646a758602bf97937e0da54507e1156b9728261a15ebba8de6618266002b5e6b5b02699bf0661f45da128b
@@ -25,6 +25,15 @@ class DockerfileGenerator < Rails::Generators::Base
25
25
  class_option :mysql, type: :boolean, default: false,
26
26
  desc: 'include mysql libraries'
27
27
 
28
+ class_option :jemalloc, type: :boolean, default: false,
29
+ desc: 'use jemalloc alternative malloc implementation'
30
+
31
+ class_option :fullstaq, type: :boolean, default: false,
32
+ descr: 'use Fullstaq Ruby image from Quay.io'
33
+
34
+ class_option :yjit, type: :boolean, default: false,
35
+ desc: 'enable YJIT optimizing compiler'
36
+
28
37
  def generate_app
29
38
  source_paths.push File.expand_path('./templates', __dir__)
30
39
 
@@ -35,7 +35,11 @@ RUN npm run build
35
35
 
36
36
 
37
37
  <% end -%>
38
+ <% if options.fullstaq -%>
39
+ FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-<%= @options.jemalloc ? 'jemalloc-' : '' %>slim as base
40
+ <% else -%>
38
41
  FROM ruby:$RUBY_VERSION-slim as base
42
+ <% end -%>
39
43
 
40
44
  # Rails app lives here
41
45
  WORKDIR /rails
@@ -169,7 +173,10 @@ COPY --from=client /rails/<%= api_client_dir %>/build /rails/public
169
173
 
170
174
  # Deployment options
171
175
  ENV RAILS_LOG_TO_STDOUT="1" \
172
- RAILS_SERVE_STATIC_FILES="true"
176
+ RAILS_SERVE_STATIC_FILES="true"<% if options.yjit %> \
177
+ RUBY_YJIT_ENABLE="1"<% end %><% if options.jemalloc and not options.fullstaq %> \
178
+ LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" \
179
+ MALLOC_CONF="dirty_decay_ms:1000,narenas:2,background_thread:true"<% end %>
173
180
 
174
181
  # Entrypoint prepares the database.
175
182
  ENTRYPOINT ["/rails/bin/docker-entrypoint"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Ruby