Skip to content

Commit 32c6c8b

Browse files
committed
feat: add support for passing gunicor flags via env
1 parent 28f7a7a commit 32c6c8b

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

scripts/bin/django-gunicorn

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
python manage.py migrate
44

5-
exec gunicorn \
6-
-w 2 \
7-
-k gthread \
8-
-b 0.0.0.0:8000 \
9-
project.wsgi:application
5+
default_flags=(
6+
-w 2
7+
-k gthread
8+
-b 0.0.0.0:8000
9+
)
10+
11+
if [[ -n "$GUNICORN_FLAGS" ]]; then
12+
mapfile -t flags < <(xargs -n 1 <<< "$GUNICORN_FLAGS")
13+
else
14+
flags=("${default_flags[@]}")
15+
fi
16+
17+
exec gunicorn "${flags[@]}" project.wsgi:application

0 commit comments

Comments
 (0)