forked from ijmarshall/trialstreamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·40 lines (36 loc) · 896 Bytes
/
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
#!/bin/sh
OPTS=$CMD
if [ -z "$OPTS" ]
then
OPTS=$1
fi
case "$OPTS" in
api-dev)
echo "[entrypoint.sh] Starting Trialstreamer API in Development mode"
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
export FLASK_APP=server:flask_app
export FLASK_ENV=development
flask run --host 0.0.0.0 --port $TRIALSTREAMER_TS_PORT --eager-loading
;;
api)
echo "[entrypoint.sh] Starting Trialstreamer API"
gunicorn --worker-class gevent --workers $GUNICORN_WORKERS --timeout $GUNICORN_WORKER_TIMEOUT -b 0.0.0.0:$TRIALSTREAMER_TS_PORT server:app
;;
cron)
echo "[entrypoint.sh] Starting Trialstreamer Updates Crontab"
export > /var/lib/deploy/cron.env
chmod 0644 /etc/cron.d/crontab
crontab /etc/cron.d/crontab
cron -f
;;
*)
if [ ! -z "$(which $1)" ]
then
$@
else
echo "Invalid command"
exit 1
fi
;;
esac