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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438d7f814f08f6180930a72f8b2e6437cb3b53b45ff495d99a0e5abf5c85e361
|
4
|
+
data.tar.gz: 71d21d72fc2aea9062fa9ba15e491083d279caa050f264e36de424a42e70ef44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"]
|