Sha256: 9f3945ad294b2968908642a2a765cf88a2150843522c282d494d81fdf5a546a7

Contents?: true

Size: 799 Bytes

Versions: 5

Compression:

Stored size: 799 Bytes

Contents

#!/bin/bash -e

<% 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

5 entries across 5 versions & 1 rubygems

Version Path
dockerfile-rails-1.2.0 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.1.2 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.1.1 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.1.0 lib/generators/templates/docker-entrypoint.erb
dockerfile-rails-1.0.18 lib/generators/templates/docker-entrypoint.erb