-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
39 lines (36 loc) · 1.05 KB
/
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
#!/bin/bash
if [ ! -f /debug0 ]; then
if [ -e requirements.txt ]; then
pip2 install -r requirements.txt
fi
touch /debug0
while getopts 'hdo:' flag; do
case "${flag}" in
h)
echo "options:"
echo "-h show brief help"
echo "-d debug mode, no nginx or uwsgi, direct start with 'python app.py'"
echo "-o gid installs docker into the container, gid should be the docker group id of your docker server"
exit 0
;;
d)
touch /debug1
;;
o)
apk add --no-cache docker shadow
groupmod -g ${OPTARG} docker
gpasswd -a nginx docker
;;
*)
break
;;
esac
done
fi
if [ -e /debug1 ]; then
echo "Running app in debug mode!"
python2 app.py
else
echo "Running app in production mode!"
nginx && uwsgi --ini /app.ini
fi