docker-entrypoint 387 B

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