Skip to content

Commit

Permalink
Merge branch 'main' into github-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary-H9 authored Nov 29, 2023
2 parents 04d979b + 1d65b01 commit 9367332
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env sh

MODE=${MODE:-"run"}
ADDRESS=${ADDRESS:-"0.0.0.0"}
PORT=${PORT:-"8000"}
WORKERS=${WORKERS:-"4"}

case "$MODE" in
"run")
echo "Running Django server"
gunicorn -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker -w 4 controlpanel.asgi:application
echo "Running Django server on ${ADDRESS}:${PORT}"
gunicorn -b "${ADDRESS}":"${PORT}" -k uvicorn.workers.UvicornWorker -w "${WORKERS}" controlpanel.asgi:application
;;
"migrate")
echo "Running Django migrations"
python manage.py migrate
;;
*)
echo "Unknown mode: $MODE"
echo "Unknown mode: ${MODE}"
exit 1
;;
esac

0 comments on commit 9367332

Please sign in to comment.