View raw

1 #!/bin/bash -e 2 3 # Enable jemalloc for reduced memory usage and latency. 4 if [ -z "${LD_PRELOAD+x}" ]; then 5 LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit) 6 export LD_PRELOAD 7 fi 8 9 # If running the rails server then create or migrate existing database 10 if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then 11 ./bin/rails db:prepare 12 fi 13 14 exec "${@}" 15