9945: Merge branch 'master' into 9945-make-python-package-dependency-free
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / workbench2 / run-service
1 #!/bin/bash
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 exec 2>&1
7 set -ex -o pipefail
8
9 .  /usr/local/lib/arvbox/common.sh
10
11 cd /usr/src/workbench2
12
13 npm -d install --prefix /usr/local --global yarn
14
15 yarn install
16
17 if test "$1" = "--only-deps" ; then
18     exit
19 fi
20
21 cat <<EOF > /usr/src/workbench2/public/config.json
22 {
23   "API_HOST": "${localip}:${services[controller-ssl]}",
24   "VOCABULARY_URL": "vocabulary-example.json",
25   "FILE_VIEWERS_CONFIG_URL": "file-viewers-example.json"
26 }
27 EOF
28
29 export HTTPS=false
30 # Can't use "yarn start", need to run the dev server script
31 # directly so that the TERM signal from "sv restart" gets to the
32 # right process.
33 exec node node_modules/react-scripts-ts/scripts/start.js