-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: script to start the web server in debug mode
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
echo "Ready to start the web server in debug mode" | ||
cd /code | ||
export INVENIO_SECRET_KEY=$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | fold -w 10 | head -n 1) | ||
if [ -d "/opt/invenio/var/instance/python/lib/python3.9/site-packages/cernopendata" ]; then | ||
echo "The installation directory is still there... let's overwrite it" | ||
cp /code/cernopendata/setup.py /code/setup.py | ||
pip install -e . | ||
|
||
if [ -d "/cold" ]; then | ||
cd /cold | ||
pip install -e . | ||
fi | ||
fi | ||
|
||
if [ "$1" == "worker" ]; then | ||
echo "Starting the celery worker" | ||
celery -A cernopendata.celery worker --beat --loglevel=INFO --concurrency=1 | ||
else | ||
echo "Starting the web server" | ||
cernopendata run -h 0.0.0.0 --reload; | ||
fi | ||
echo "THE WEB SERVICE DIED!!! Let's sleep for a bit to give some time to debug" | ||
sleep 60 |