dockerfile-rails 1.1.2 → 1.2.1

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: 9c9c9a8eb85b3dbb31aefb0f0f3fa9bac0ab070e0b2807a0e084cc553643ece4
4
- data.tar.gz: 79388988476275627c99e27630556b02a732b7baf9737003ac5276395825ed14
3
+ metadata.gz: cf2a81e905971b1372422667990588003a30836174b539622aab105a84da0a3b
4
+ data.tar.gz: 54719c03a535654284006637b1ed1d29ae418c3686d7ecc773eaf510d75268ea
5
5
  SHA512:
6
- metadata.gz: 78271283892ec8c0140ca96a6bc3347c2836ca6f720752f3d5956d8bd267a63efb1b19a6efa1ba45b8cb045e4e7e036c3ec74c9aa2b816a347ed9f26276e5134
7
- data.tar.gz: 036137a0829ecc764007181d4332b940d45f15197e02360db7d6ac960039463084d3ceaeae65f269b813896fbe4daabc1e97dcb16b42f7dd2db992848985f040
6
+ metadata.gz: b45fb087b5fed35931979b86ab5399af2a0406bba06eecbb3c6130272af1b429cb83a4f9d5fa8909e3b3d72ae124303ccff4fbe8b14ab3a2c4c57029e5057794
7
+ data.tar.gz: b022381f3e9a3639583345bebbf525ae67468c49f37ba8a659cc6ca14b4304865126c837d51935b5cad06cab50df00397b08aafd5a7595b40e93d056ffeb17b2
data/README.md CHANGED
@@ -108,3 +108,4 @@ The following links relate to the current development status with respect to Rai
108
108
  * [app/templates/Dockerfile.tt](https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/Dockerfile.tt) - current Rails 7.1 template
109
109
  * Fly.io [Cut over to Rails Dockerfile Generator on Sunday 29 Jan 2023](https://community.fly.io/t/cut-over-to-rails-dockerfile-generator-on-sunday-29-jan-2023/10350)
110
110
  * Fly.io [FAQ](https://fly.io/docs/rails/getting-started/dockerfiles/)
111
+ * DDH's [target](https://github.com/rails/rails/pull/47372#issuecomment-1438971730)
@@ -311,7 +311,7 @@ private
311
311
  packages += @@packages["base"] if @@packages["base"]
312
312
 
313
313
  if using_execjs?
314
- packages += %w(curl unzip)
314
+ packages += %w(curl)
315
315
  end
316
316
 
317
317
  if using_puppeteer?
@@ -364,7 +364,7 @@ private
364
364
  # node support, including support for building native modules
365
365
  if using_node?
366
366
  packages += %w(node-gyp pkg-config)
367
- packages += %w(curl unzip) unless using_execjs? || using_puppeteer?
367
+ packages += %w(curl) unless using_execjs? || using_puppeteer?
368
368
 
369
369
  # module build process depends on Python, and debian changed
370
370
  # how python is installed with the bullseye release. Below
@@ -464,7 +464,7 @@ private
464
464
  env = {}
465
465
 
466
466
  if using_execjs?
467
- env["PATH"] = "/root/.local/share/fnm/aliases/default/bin/:$PATH"
467
+ env["PATH"] = "/usr/local/node/bin:$PATH"
468
468
  end
469
469
 
470
470
  if using_puppeteer?
@@ -164,7 +164,9 @@ RUN groupadd -f -g $GID rails && \
164
164
  useradd -u $UID -g $GID rails<% else -%>
165
165
  RUN useradd rails<% end -%><% if options.nginx? %> && \
166
166
  chown rails:rails /var/lib/nginx /var/log/nginx/*<% end %>
167
+ <% unless options.swap -%>
167
168
  USER rails:rails
169
+ <% end -%>
168
170
 
169
171
  <% end -%>
170
172
  <% unless options.precompile == "defer" -%>
@@ -12,12 +12,11 @@ ARG NODE_VERSION=<%= node_version %>
12
12
  ARG YARN_VERSION=<%= yarn_version %>
13
13
  <% end -%>
14
14
  <% if node_version -%>
15
- RUN curl -fsSL https://fnm.vercel.app/install | bash && \
16
- /root/.local/share/fnm/fnm install $NODE_VERSION<% if !run_as_root? && using_execjs? %> && \
17
- mv /root/.local/share/fnm/aliases/default/bin/node /usr/local/bin<% end %>
18
- <% if !using_execjs? || yarn_version -%>
19
- ENV PATH=/root/.local/share/fnm/aliases/default/bin/:$PATH
20
- <% end -%>
15
+ ENV PATH=/usr/local/node/bin:$PATH
16
+ RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
17
+ /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
18
+ npm install -g yarn@$YARN_VERSION && \
19
+ rm -rf /tmp/node-build-master
21
20
  <% end -%>
22
21
  <% if yarn_version -%>
23
22
  <% if yarn_version < '2' -%>
@@ -30,4 +29,4 @@ RUN corepack enable && \
30
29
  <% end -%>
31
30
  corepack prepare yarn@$YARN_VERSION --activate
32
31
  <% end -%>
33
- <% end -%>
32
+ <% end -%>
@@ -1,13 +1,23 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  <% if options.swap -%>
4
- # allocate swap space
5
- fallocate -l <%= options.swap %> /swapfile
6
- chmod 0600 /swapfile
7
- mkswap /swapfile
8
- echo 10 > /proc/sys/vm/swappiness
9
- swapon /swapfile
10
- echo 1 > /proc/sys/vm/overcommit_memory
4
+ <% if run_as_root? -%>
5
+ <% @space = "" -%>
6
+ <% else -%>
7
+ <% @space = " " -%>
8
+ if [ $UID -eq 0 ]; then
9
+ <% end -%>
10
+ <%= @space %># allocate swap space
11
+ <%= @space %>fallocate -l <%= options.swap %> /swapfile
12
+ <%= @space %>chmod 0600 /swapfile
13
+ <%= @space %>mkswap /swapfile
14
+ <%= @space %>echo 10 > /proc/sys/vm/swappiness
15
+ <%= @space %>swapon /swapfile
16
+ <%= @space %>echo 1 > /proc/sys/vm/overcommit_memory
17
+ <% unless run_as_root? -%>
18
+ exec su rails $0 $@
19
+ fi
20
+ <% end -%>
11
21
 
12
22
  <% end -%>
13
23
  <% if options.prepare -%>
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.1.2
4
+ version: 1.2.1
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-02-20 00:00:00.000000000 Z
11
+ date: 2023-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails