Merge branch '12377-arvbox-composer' refs #12377
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / api / run-service
index 5f72f1c613192e5b8aa806a0f490711b6055ff69..f7ab6be6a03549fb84ead7628ebd98648f4e5750 100755 (executable)
@@ -1,4 +1,7 @@
 #!/bin/bash
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
 exec 2>&1
 set -ex -o pipefail
@@ -6,7 +9,12 @@ set -ex -o pipefail
 . /usr/local/lib/arvbox/common.sh
 
 cd /usr/src/arvados/services/api
-export RAILS_ENV=development
+
+if test -s /var/lib/arvados/api_rails_env ; then
+  export RAILS_ENV=$(cat /var/lib/arvados/api_rails_env)
+else
+  export RAILS_ENV=development
+fi
 
 run_bundler --without=development
 bundle exec passenger-config build-native-support