29 lines
925 B
Bash
Executable File
29 lines
925 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
python manage.py tailwind install --no-input
|
|
python manage.py tailwind build
|
|
python manage.py migrate --noinput
|
|
python manage.py collectstatic --noinput
|
|
python manage.py update_index
|
|
|
|
# Set Wagtail site hostname from WAGTAILADMIN_BASE_URL when available.
|
|
# This keeps preview/page URLs on the same origin as the admin host.
|
|
python manage.py shell -c "
|
|
from wagtail.models import Site
|
|
import os
|
|
from urllib.parse import urlparse
|
|
|
|
admin_base = os.environ.get('WAGTAILADMIN_BASE_URL', '').strip()
|
|
parsed = urlparse(admin_base) if admin_base else None
|
|
hostname = parsed.hostname if parsed and parsed.hostname else os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')[0].strip()
|
|
Site.objects.update(hostname=hostname, port=443, site_name='No Hype AI')
|
|
"
|
|
|
|
exec gunicorn config.wsgi:application \
|
|
--workers 3 \
|
|
--bind 0.0.0.0:8000 \
|
|
--access-logfile - \
|
|
--error-logfile - \
|
|
--capture-output
|