Files
api/bin/docker-entrypoint
T
Jason Jordan 1c80e642f5
CI / scan_ruby (push) Failing after 37s
CI / lint (push) Failing after 39s
Production Build Working
2026-09-16 12:41:44 -04:00

22 lines
563 B
Bash

#!/bin/bash -e
# 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
# If running the rails server then migrate existing database
if [ "${1}" == "bundle" ] && [ "${2}" == "exec" ] && [ "${3}" == "puma" ]; then
echo "running migrations..."
./bin/rails db:migrate
fi
rm -f /usr/src/app/tmp/pids/server.pid
rm -rf /usr/local/bundle/cache/*.gem
echo "bundle install..."
bundle check || bundle install --jobs 4
exec "${@}"