Sha256: e6ba802b9e2372f61c9f2ba291e669dce3e5ab61e248f60a7c0907d9028673f8

Contents?: true

Size: 796 Bytes

Versions: 4

Compression:

Stored size: 796 Bytes

Contents

#!/bin/bash

<% if options.swap -%>
# allocate swap space
fallocate -l <%= options.swap %> /swapfile
chmod 0600 /swapfile
mkswap /swapfile
echo 10 > /proc/sys/vm/swappiness
swapon /swapfile
echo 1 > /proc/sys/vm/overcommit_memory

<% 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 [ "${*}" == "./bin/rails server" ]; 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

4 entries across 4 versions & 1 rubygems

Version Path
dockerfile-rails-1.0.17 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.0.16 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.0.15 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.0.14 lib/generators/templates/docker-entrypoint.erb