forked from waltermoreira/abaco
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathentry.sh
36 lines (33 loc) · 1.04 KB
/
entry.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
#!/bin/bash
# If the python code errors, container will exit. As exit code 1
# corresponds with error and exit code 0 corresponds with success.
if ! python3 -u /actors/conf_check.py; then
echo "Config error. Stopping Container."
exit
fi
if [ $api = "reg" ]; then
if [ $server = "dev" ]; then
python3 -u /actors/reg_api.py
else
cd /actors; /usr/local/bin/gunicorn -w $threads -b :5000 reg_api:app
fi
elif [ $api = "admin" ]; then
if [ $server = "dev" ]; then
python3 -u /actors/admin_api.py
else
cd /actors; /usr/local/bin/gunicorn -w $threads -b :5000 admin_api:app
fi
elif [ $api = "metrics" ]; then
if [ $server = "dev" ]; then
python3 -u /actors/metrics_api.py
else
cd /actors; /usr/local/bin/gunicorn -w $threads -b :5000 metrics_api:app
fi
elif [ $api = "mes" ]; then
if [ $server = "dev" ]; then
python3 -u /actors/message_api.py
else
cd /actors; /usr/local/bin/gunicorn -w $threads -b :5000 message_api:app
fi
fi
while true; do sleep 86400; done