Files
manyfold/bin/docker-entrypoint.sh
James Smith 744bd24ca1 Only set plugin path owner if writable
FIxes startup error on readonly filesystems
2026-07-02 15:41:09 +01:00

32 lines
722 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
if [ ! -d $PLUGINS_PATH ]; then
echo "Creating plugin directory..."
mkdir -p "$PLUGINS_PATH"
fi
if [ -w $PLUGINS_PATH ]; then
echo "Setting plugin directory owner..."
chown $PUID:$PGID "$PLUGINS_PATH"
fi
echo "Launching application..."
export RAILS_PORT=$PORT
export RAILS_LOG_TO_STDOUT=true
exec s6-setuidgid $PUID:$PGID $@