cookiecutter-django/{{cookiecutter.project_slug}}/compose/production/django/start
Bruno Alla 528a40989f
Fix cache dependency path for linter job in CI workflow (#3520)
* Fix cache dependency path for linter jon in CI workflow

* Reduce potential stylistic issues

* Reduce more potential stylistic issues
2022-01-07 22:26:56 +00:00

35 lines
753 B
Bash

#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
python /app/manage.py collectstatic --noinput
{% if cookiecutter.use_whitenoise == 'y' and cookiecutter.use_compressor == 'y' %}
compress_enabled() {
python << END
import sys
from environ import Env
env = Env(COMPRESS_ENABLED=(bool, True))
if env('COMPRESS_ENABLED'):
sys.exit(0)
else:
sys.exit(1)
END
}
if compress_enabled; then
# NOTE this command will fail if django-compressor is disabled
python /app/manage.py compress
fi
{%- endif %}
{%- if cookiecutter.use_async == 'y' %}
/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker
{%- else %}
/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
{%- endif %}