Changeset View
Changeset View
Standalone View
Standalone View
dockerfiles/swh-web/entrypoint.sh
#!/bin/bash | #!/bin/bash | ||||
set -e | set -e | ||||
if [[ -d /src ]] ; then | if [[ -d /src ]] ; then | ||||
for srcrepo in /src/swh-* ; do | for srcrepo in /src/swh-* ; do | ||||
pushd $srcrepo | pushd $srcrepo | ||||
echo installing $srcrepo | echo installing $srcrepo | ||||
pip install -e . | pip install -e . | ||||
popd | popd | ||||
done | done | ||||
fi | fi | ||||
echo Installed Python packages: | echo Installed Python packages: | ||||
pip list | pip list | ||||
SWH_WEB_PATH=$(python3 -c 'import os.path, swh.web; print(os.path.dirname(swh.web.__file__))') | |||||
cd $SWH_WEB_PATH | |||||
npm install | |||||
npm run build-dev | |||||
if [ "$1" = 'shell' ] ; then | if [ "$1" = 'shell' ] ; then | ||||
exec bash -i | exec bash -i | ||||
else | else | ||||
echo "starting the swh-web server" | echo "starting the swh-web server" | ||||
# options: | # options: | ||||
# --verbosity to have sensible output | # --verbosity to have sensible output | ||||
# --insecure to serve the static css/js | # --insecure to serve the static css/js | ||||
# 0.0.0.0 so that we can actually reach the service. | # 0.0.0.0 so that we can actually reach the service. | ||||
exec python3 -m swh.web.manage runserver \ | exec python3 -m swh.web.manage runserver \ | ||||
--verbosity 3 \ | --verbosity 3 \ | ||||
--insecure \ | --insecure \ | ||||
0.0.0.0:5004 | 0.0.0.0:5004 | ||||
fi | fi |