hackatime/bin/docker-entrypoint
Mahad Kalam 17d9679547
llms.txt/llms-full.txt/.md docs routes, SSR (#977)
* llms.txt/llms-full.txt/.md docs routes, SSR

* Fixes!

* Tests!

* More fixes

* Fix SSR!

* Update bin/docker-entrypoint

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Use Bun for SSR!

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-18 08:34:06 +00:00

23 lines
777 B
Bash
Executable file

#!/bin/bash -e
# Enable jemalloc for reduced memory usage and latency.
if [ -z "${LD_PRELOAD+x}" ]; then
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
export LD_PRELOAD
fi
# If running the rails server then create or migrate existing database
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
./bin/rails db:prepare
# echo "Warming up caches for production deployment..."
# ./bin/rails cache:warmup
# Start the Inertia SSR server in the background if the SSR bundle exists
SSR_ENTRYPOINT="public/vite-ssr/ssr.js"
if [ -f "$SSR_ENTRYPOINT" ]; then
echo "Starting Inertia SSR server..."
(while true; do bun "$SSR_ENTRYPOINT"; echo "SSR server exited, restarting..."; sleep 1; done) &
fi
fi
exec "${@}"