2015-11-27 17:24:15 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
|
|
BIND="${BIND:=0.0.0.0}"
|
|
|
|
|
PORT="${PORT:=8080}"
|
|
|
|
|
RAILS_ENV="${RAILS_ENV:="development"}"
|
|
|
|
|
MIGRATE="${MIGRATE:="false"}"
|
|
|
|
|
|
2020-10-13 15:47:37 +00:00
|
|
|
if [ "$RAILS_ENV" = "production" ] ; then
|
2019-07-11 10:32:21 +01:00
|
|
|
# @TODO Add apache config to serve the assets. Until then we have Puma serve
|
|
|
|
|
# them which is slower. This is ok if an asset host is used (SaaS).
|
|
|
|
|
# But for self-hosted installations we may want to fix that.
|
|
|
|
|
export OPENPROJECT_ENABLE__INTERNAL__ASSETS__SERVER=true
|
|
|
|
|
fi
|
|
|
|
|
|
2015-11-27 17:24:15 +00:00
|
|
|
if [ "$MIGRATE" = "true" ]; then
|
|
|
|
|
echo "Migrating database..."
|
|
|
|
|
bundle exec rake db:migrate
|
|
|
|
|
fi
|
|
|
|
|
|
2024-05-17 20:15:08 +02:00
|
|
|
# Clean up any dangling PID file
|
|
|
|
|
rm -f ${APP_PATH}/tmp/pids/*
|
|
|
|
|
|
2020-10-13 15:47:37 +00:00
|
|
|
# see `config/puma.rb` for configuration
|
|
|
|
|
exec bundle exec rails server -u puma -b $BIND -p $PORT
|