Sha256: b6eff34d91eae496373015beb56fbb90c25a7cfb9d01cae873cbf408feb9ac65
Contents?: true
Size: 1.47 KB
Versions: 12
Compression:
Stored size: 1.47 KB
Contents
#!/bin/bash -e <% if options.swap && !File.exist?("fly.toml")-%> <% 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 <% if using_litefs? -%> <%= @space %># mount litefs <%= @space %>litefs mount & <% end -%> <% unless run_as_root? or using_passenger? -%> exec su rails $0 $@ fi <% end -%> <% elsif using_litefs? -%> # mount litefs <% unless run_as_root? %>sudo -E <% end %>litefs mount & <% end -%> <% if options.prepare -%> <% if !options.procfile.blank? -%> if [ "${*}" == "foreman start --procfile=<%= options.procfile %>" ]; then <% elsif 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 %> <% if using_litefs? %>-a "$FLY_REGION" == "$PRIMARY_REGION" <%end%>]; then <% end -%> <% if options.precompile == "defer" -%> ./bin/rails assets:precompile <% end -%> <%= dbprep_command %> fi <% elsif !options.swap -%> # Add any container initialization steps here <% end -%> exec "${@}"
Version data entries
12 entries across 12 versions & 1 rubygems