OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
made docker container work with subdirectory (RAILS_RELATIVE_URL_ROOT)
Markus Kahl7bb59dde9e52
diff --git a/config.ru b/config.ruindex 78f6f6434b9..c8fffca44b4 100644--- a/config.ru+++ b/config.ru@@ -48,14 +48,7 @@ if defined?(Unicorn) && Rails.env.production?use Unicorn::WorkerKiller::MaxRequests, min_req, max_reqend-##-# Returns true if the application should be run under a subdirectory.-def map_subdir?- # Don't map subdir when using Passenger as passenger takes care of that.- !defined?(::PhusionPassenger)-end--subdir = map_subdir? && OpenProject::Configuration.rails_relative_url_root.presence+subdir = OpenProject::Configuration.rails_relative_url_root.presencemap (subdir || '/') douse Rack::Protection::JsonCsrfdiff --git a/docker/precompile-assets.sh b/docker/precompile-assets.shindex 334fb23a187..4f12938ad4f 100644--- a/docker/precompile-assets.sh+++ b/docker/precompile-assets.sh@@ -3,6 +3,8 @@ set -epushd "${APP_PATH}/frontend"+export NG_CLI_ANALYTICS=ci # so angular cli doesn't block waiting for user input+# Installing frontend dependenciesRAILS_ENV=production npm installdiff --git a/docker/supervisord b/docker/supervisordindex 59e0fbad80b..9adf4b3a9b8 100755--- a/docker/supervisord+++ b/docker/supervisord@@ -68,9 +68,8 @@ migrate() {wait_for_postgrespushd $APP_PATH >/dev/null/etc/init.d/memcached start- bundle exec rake db:migrate db:seed db:structure:dump+ bundle exec rake db:migrate db:seed/etc/init.d/memcached stop- chown "$APP_USER.$APP_USER" db/structure.sqlpopd >/dev/null}@@ -111,5 +110,13 @@ fiecho "-----> Database setup finished."echo " On first installation, the default admin credentials are login: admin, password: admin"+if [ -n "$OPENPROJECT_RAILS__RELATIVE__URL__ROOT" ]; then+ echo+ echo "-----> Precompiling assets since RAILS_RELATIVE_URL_ROOT is set. This may take a minute."+ RAILS_RELATIVE_URL_ROOT=$OPENPROJECT_RAILS__RELATIVE__URL__ROOT bash /app/docker/precompile-assets.sh+ echo "-----> Asset precompilation finished."+ echo+fi+echo "-----> Launching supervisord..."exec /usr/bin/supervisord -c $APP_PATH/docker/supervisord.conf -e ${SUPERVISORD_LOG_LEVEL}