#!/usr/bin/env sh set -eux case "${1}" in gunicorn) # shellcheck disable=SC2086 exec gunicorn config.asgi:application \ --workers "${FUNKWHALE_WEB_WORKERS:-1}" \ --worker-class uvicorn.workers.UvicornWorker \ --bind 0.0.0.0:"${FUNKWHALE_API_PORT}" \ ${GUNICORN_ARGS:-} ;; migrate) funkwhale-manage migrate ;; collectstatic) funkwhale-manage collectstatic --noinput ;; uvicorn) exec uvicorn \ --reload config.asgi:application \ --host 0.0.0.0 \ --port 5000 \ --reload-dir config/ \ --reload-dir funkwhale_api/ ;; develop) ${0} migrate ${0} collectstatic ${0} uvicorn ;; develop-worker) export CELERYD_CONCURRENCY=0 watchmedo auto-restart \ --patterns="*.py" \ --recursive \ -- \ celery \ -A funkwhale_api.taskapp worker \ -B \ -l debug \ -s /tmp/celerybeat-schedule \ --concurrency=${CELERYD_CONCURRENCY} ;; *) exec "${@}" ;; esac