Sha256: 0c4dc1a62cc3beca1f51ef1e59d246163eefa9ed19df62217ebaa76581d4dd6b
Contents?: true
Size: 1.09 KB
Versions: 1
Compression:
Stored size: 1.09 KB
Contents
#!/bin/bash -e <% if options.swap -%> <% if run_as_root? or using_passenger? -%> <% @space = "" -%> <% else -%> <% @space = " " -%> if [ $UID -eq 0 ]; then <% end -%> <%= @space %># allocate swap space <%= @space %>fallocate -l <%= options.swap %> /swapfile <%= @space %>chmod 0600 /swapfile <%= @space %>mkswap /swapfile <%= @space %>echo 10 > /proc/sys/vm/swappiness <%= @space %>swapon /swapfile <%= @space %>echo 1 > /proc/sys/vm/overcommit_memory <% unless run_as_root? or using_passenger? -%> exec su rails $0 $@ fi <% end -%> <% end -%> <% if options.prepare -%> <% if procfile.size > 1 -%> # If running the production procfile then create or migrate existing database if [ "${*}" == "foreman start --procfile=Procfile.prod" ]; then <% else -%> # If running the rails server then create or migrate existing database if [ "${*}" == <%= procfile.values.first.inspect %> ]; then <% end -%> <% if options.precompile == "defer" -%> ./bin/rails assets:precompile <% end -%> ./bin/rails <%= dbprep_command %> fi <% elsif !options.swap -%> # Add any container initialization steps here <% end -%> exec "${@}"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
dockerfile-rails-1.3.0 | lib/generators/templates/docker-entrypoint.erb |