Browse Source

Support async upload for Dockerfile version

pull/1310/head
Hironsan 3 years ago
parent
commit
6ec97b28ad
2 changed files with 19 additions and 1 deletions
  1. 1
      Dockerfile
  2. 19
      tools/run.sh

1
Dockerfile

@ -59,6 +59,7 @@ ENV DEBUG="True"
ENV SECRET_KEY="change-me-in-production"
ENV PORT="8000"
ENV WORKERS="2"
ENV CELERY_WORKERS="2"
ENV GOOGLE_TRACKING_ID=""
ENV AZURE_APPINSIGHTS_IKEY=""

19
tools/run.sh

@ -26,4 +26,21 @@ if [[ -n "${ADMIN_USERNAME}" ]] && [[ -n "${ADMIN_PASSWORD}" ]] && [[ -n "${ADMI
fi
echo "Starting django"
gunicorn --bind="0.0.0.0:${PORT:-8000}" --workers="${WORKERS:-4}" app.wsgi --timeout 300
# gunicorn --bind="0.0.0.0:${PORT:-8000}" --workers="${WORKERS:-4}" app.wsgi --timeout 300
gunicorn --bind="0.0.0.0:${PORT:-8000}" --workers="${WORKERS:-1}" app.wsgi --timeout=300 &
gunicorn_pid="$!"
celery --app=app worker --loglevel=INFO --concurrency="${CELERY_WORKERS:-1}" &
celery_pid="$!"
while :; do
if [[ ! -e "/proc/${celery_pid}" ]]; then
echo "celery crashed" >&2
exit 1
elif [[ ! -e "/proc/${gunicorn_pid}" ]]; then
echo "gunicorn crashed" >&2
exit 2
else
sleep 10
fi
done
Loading…
Cancel
Save