-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-entrypoint.sh
executable file
·41 lines (31 loc) · 1.38 KB
/
docker-entrypoint.sh
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
#!/bin/bash
python3 manage.py migrate --run-syncdb
# python3 manage.py createfixtures
python3 manage.py cleanuptasks
file="docker-entrypoint.lock"
# exit if entrypoint.lock exists to prevent new import of data every time docker is restarted
if ! test -f "$file"; then
# create docker-entrypoint.lock to see that data was already imported
# used for development, otherwise db reset after each docker-start at system start
# to reload db on docker restart, simply delete the file
if [ -z "$DB_UPDATE_ON_START" ] || [ "$DB_UPDATE_ON_START" = "0" ]
then
echo "Update on startup disabled!"
else
sh import-data.sh
echo "building graphs"
python3 manage.py make_graphs
echo "building minimum spanning trees"
python3 manage.py make_min_span_trees
# python manage.py make_shortest_distance_files
# python manage.py populate_db --add_data shortest_distances
# add polyphen2 data for SNP lookup
mkdir data/poly phen2/
wget https://cloud.uni-hamburg.de/s/4dDob7rNisAjd2Q/download/polyphen-2.2.2-whess-2011_12.sqlite.bz2 -O data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
# unpack the bz2 sqlite database and delete compressed file
bzip2 -d data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite.bz2
chmod 777 data/polyphen2/polyphen-2.2.2-whess-2011_12.sqlite
fi
touch $file
fi
/usr/bin/supervisord -c "/etc/supervisor/conf.d/supervisord.conf"