2023-09-10 11:37:37 -04:00
|
|
|
#!/bin/bash -e
|
2023-03-12 10:27:02 -04:00
|
|
|
|
2024-06-21 23:35:36 -04:00
|
|
|
# Enable jemalloc for reduced memory usage and latency.
|
|
|
|
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
|
|
|
|
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
|
|
|
|
fi
|
|
|
|
|
2023-09-10 11:37:37 -04:00
|
|
|
# If running the rails server then create or migrate existing database
|
2024-06-21 23:35:36 -04:00
|
|
|
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
|
2023-03-12 10:27:02 -04:00
|
|
|
./bin/rails db:prepare
|
|
|
|
fi
|
2023-09-10 11:37:37 -04:00
|
|
|
|
|
|
|
exec "${@}"
|