fly.io-rails 0.0.11-x86-linux → 0.0.12-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fly.io-rails/version.rb +1 -1
- data/lib/generators/templates/Dockerfile.erb +31 -0
- data/lib/generators/terraform_generator.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 781bb4132af54e48da60f6b907af330d3e53de2d9678d734318a853b8da9d230
|
4
|
+
data.tar.gz: 99fb3ddbfa80ea0394a9114c53bad0334a174ed8a323a59a63d5bd96580716c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e81d15a74756cc34436808d5dea256dbf2030160cea7e57e3f2f5c88dd74d587ca6e251c714ccd47a2cc74a5848d9a2925b720a1b3470dfcf70d9f1392e00aad
|
7
|
+
data.tar.gz: d8e2111b357ec2997049a09eccba0147a137f2c447d5b846c9425b198b4e74f2d99dfb9493f7120dd77a81b2d99e6b0e318897a47d7595d7b1b206359fc75f9a
|
data/lib/fly.io-rails/version.rb
CHANGED
@@ -21,6 +21,9 @@ ARG RUBY_VERSION=<%= @ruby_version %>
|
|
21
21
|
ARG VARIANT=jemalloc-slim
|
22
22
|
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base
|
23
23
|
|
24
|
+
<% if @node -%>
|
25
|
+
ARG NODE_VERSION=<%= @node_version %>
|
26
|
+
<% end -%>
|
24
27
|
ARG BUNDLER_VERSION=<%= @bundler_version %>
|
25
28
|
|
26
29
|
ARG RAILS_ENV=production
|
@@ -38,6 +41,13 @@ RUN mkdir /app
|
|
38
41
|
WORKDIR /app
|
39
42
|
RUN mkdir -p tmp/pids
|
40
43
|
|
44
|
+
<% if @node -%>
|
45
|
+
RUN curl https://get.volta.sh | bash
|
46
|
+
ENV VOLTA_HOME /root/.volta
|
47
|
+
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
|
48
|
+
RUN volta install node@${NODE_VERSION}
|
49
|
+
|
50
|
+
<% end -%>
|
41
51
|
#######################################################################
|
42
52
|
|
43
53
|
# install packages only needed at build time
|
@@ -65,6 +75,22 @@ RUN gem update --system --no-document && \
|
|
65
75
|
COPY Gemfile* ./
|
66
76
|
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache
|
67
77
|
|
78
|
+
<% if @node -%>
|
79
|
+
#######################################################################
|
80
|
+
|
81
|
+
# install node modules
|
82
|
+
|
83
|
+
FROM build_deps as node_modules
|
84
|
+
|
85
|
+
COPY package*json ./
|
86
|
+
<% if @yarn -%>
|
87
|
+
COPY yarn.* ./
|
88
|
+
RUN volta install yarn && yarn install;
|
89
|
+
<% else -%>
|
90
|
+
RUN npm install
|
91
|
+
<% end -%>
|
92
|
+
|
93
|
+
<% end -%>
|
68
94
|
#######################################################################
|
69
95
|
|
70
96
|
# install deployment packages
|
@@ -86,6 +112,11 @@ COPY --from=gems /app /app
|
|
86
112
|
COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
|
87
113
|
COPY --from=gems /usr/local/bundle /usr/local/bundle
|
88
114
|
|
115
|
+
<% if @node -%>
|
116
|
+
# copy installed node modules
|
117
|
+
COPY --from=node_modules /app/node_modules /app/node_modules
|
118
|
+
|
119
|
+
<% end -%>
|
89
120
|
#######################################################################
|
90
121
|
|
91
122
|
# Deploy your application
|
@@ -31,7 +31,11 @@ class TerraformGenerator < Rails::Generators::Base
|
|
31
31
|
|
32
32
|
@ruby_version = RUBY_VERSION
|
33
33
|
@bundler_version = Bundler::VERSION
|
34
|
+
@node = File.exist? 'node_modules'
|
35
|
+
@yarn = File.exist? 'yarn.lock'
|
36
|
+
@node_version = @node ? `node --version`.chomp.sub(/^v/, '') : '16.17.0'
|
34
37
|
@appName = @app.gsub('-', '_').camelcase(:lower)
|
38
|
+
|
35
39
|
template 'Dockerfile.erb', 'Dockerfile'
|
36
40
|
template 'dockerignore.erb', '.dockerignore'
|
37
41
|
template 'main.tf.erb', 'main.tf'
|