Files
manyfold/bin/docker-entrypoint.sh
T
James Smith 90b8acc719 Add a stable env var for the rails app port
so that foreman doesn't autoincrement it and we can use it in workers
2024-08-02 12:41:43 +01:00

22 lines
477 B
Bash
Executable File

#!/bin/ash
set -e
if [ -f tmp/pids/server.pid ]; then
rm tmp/pids/server.pid
fi
echo "Preparing database..."
bundle exec rails db:prepare:with_data
echo "Setting database file ownership (SQLite3 only)..."
bundle exec rake db:chown
echo "Cleaning up old cache files..."
bundle exec rake tmp:cache:clear
echo "Setting temporary directory permissions..."
chown -R $PUID:$PGID tmp log
echo "Launching application..."
export RAILS_PORT=$PORT
exec s6-setuidgid $PUID:$PGID $@