Sha256: c3ed12222c75be8065b703d0244542d329a5fc3e7487f7053855081e622d16f3
Contents?: true
Size: 1.8 KB
Versions: 22
Compression:
Stored size: 1.8 KB
Contents
<% if options.alpine? -%> #!/bin/sh -e <% else -%> #!/bin/bash -e <% end -%> <% 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 <% elsif procfile.values.first.start_with? "./bin/rails server" -%> # If running the rails server then create or migrate existing database if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]<% if using_litefs? %> && [ "$FLY_REGION" == "$PRIMARY_REGION" ]<%end%>; 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
22 entries across 22 versions & 1 rubygems