-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-run.sh
44 lines (34 loc) · 935 Bytes
/
docker-run.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
42
43
44
#!/bin/bash
cd /app/
if [[ "$SETTINGS" ]]; then
export DJANGO_SETTINGS_MODULE="$APP.$SETTINGS"
else
export DJANGO_SETTINGS_MODULE="$APP.settings_docker"
fi
if [ "$1" == "migrate" ]; then
exec /ve/bin/python manage.py migrate --noinput
fi
if [ "$1" == "collectstatic" ]; then
exec /ve/bin/python manage.py collectstatic --noinput
fi
if [ "$1" == "shell" ]; then
exec /ve/bin/python manage.py shell
fi
if [ "$1" == "worker" ]; then
exec /ve/bin/python manage.py celery worker
fi
if [ "$1" == "beat" ]; then
exec /ve/bin/python manage.py celery beat
fi
# run arbitrary commands
if [ "$1" == "manage" ]; then
shift
exec /ve/bin/python manage.py "$@"
fi
if [ "$1" == "run" ]; then
exec /ve/bin/gunicorn --env \
DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE \
$APP.wsgi:application -b 0.0.0.0:8000 -w 3 \
-t 600 \
--access-logfile=- --error-logfile=-
fi