-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·46 lines (41 loc) · 1.5 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·46 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
cd /home/idp
# Wait for the database if necessary
if [ -n "${STEX_DBHOST}" ]; then
dbport=$STEX_DBPORT
if [ -z "${STEX_DBPORT}" ]; then
case $STEX_DBENGINE in
mysql)
dbport="3306"
;;
postgresql_psycopg2)
dbport="5432"
;;
esac
fi
now=$(date)
echo $now
echo "Waiting for ${STEX_DBHOST}:${dbport} to come online"
./wait-for-it.sh "${STEX_DBHOST}:${dbport}" -t 60 -- echo "######### Initialising Stexaminer #########"
fi
# Do the necessary DB migrations
echo "######### Doing database migrations #########"
cd /home/idp
echo "### Pack py-model changes into a file ('makemigrations')###"
#python manage.py makemigrations
python manage.py makemigrations api_app
echo "### Apply those changes to the database ('migrate') ###"
#python manage.py migrate --run-syncdb
python manage.py migrate ### what is the difference to above?!
# Start celery worker
echo "######### Starting Celery worker #########"
#celery -E -A idp3_async_api_djproj worker &
celery -A idp3_async_api_djproj worker --loglevel=DEBUG &
#celery -A idp3_async_api_djproj worker --config=settings & ### Error: No such option: --config
# Start Django server
echo "######### Starting Django server #########"
python manage.py runserver 0.0.0.0:8000
# Start flower web app to provide real-time information about the status of
# Celery workers and tasks
##echo "######### Starting Celery flower #########"
##celery -A idp3_async_api_djproj flower