dockerfile-rails 1.2.0 → 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: e8dc8b1f01f52091af8e9cb3322db265d96698e80fc203bfc570135efd69cb06
4
- data.tar.gz: 6054ee7cb322ed79092c6205cce1969b7ab9ad1d868113024845d90bb52d4448
3
+ metadata.gz: cf2a81e905971b1372422667990588003a30836174b539622aab105a84da0a3b
4
+ data.tar.gz: 54719c03a535654284006637b1ed1d29ae418c3686d7ecc773eaf510d75268ea
5
5
  SHA512:
6
- metadata.gz: 938d057a8f5faf7cca766898b5f6406a379bf90c1fc6116c05759e38a7d7439efdad941855a8cdf4029cc9aadd0131d7463a855e702fe8a69b7746250e1bfbd5
7
- data.tar.gz: 4be1203c6fa6176c867dae6ef78511aa5e0a3c9943958430a8b77ba04cbb5368371d4ea3e100d4a037946cfd0f94ee7ced7425a1464bfe75450a3c1cc8703dbc
6
+ metadata.gz: b45fb087b5fed35931979b86ab5399af2a0406bba06eecbb3c6130272af1b429cb83a4f9d5fa8909e3b3d72ae124303ccff4fbe8b14ab3a2c4c57029e5057794
7
+ data.tar.gz: b022381f3e9a3639583345bebbf525ae67468c49f37ba8a659cc6ca14b4304865126c837d51935b5cad06cab50df00397b08aafd5a7595b40e93d056ffeb17b2
@@ -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" -%>
@@ -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.2.0
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-23 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