mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +01:00
43 lines
1.0 KiB
Bash
Executable File
43 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Exit on error
|
|
set -e
|
|
|
|
# Apply database migrations
|
|
echo "Applying database migrations..."
|
|
python manage.py makemigrations
|
|
python manage.py migrate
|
|
|
|
# Create cache table for ratelimiting
|
|
echo "Creating cache table..."
|
|
python manage.py createcachetable
|
|
|
|
# Collect static files
|
|
echo "Collecting static files..."
|
|
python manage.py collectstatic --no-input
|
|
|
|
# Ensure media and cache directories exist
|
|
mkdir -p media/flavors
|
|
mkdir -p django_cache
|
|
chmod -R 777 django_cache
|
|
|
|
# Sync flavors from the API
|
|
echo "Syncing flavors..."
|
|
python manage.py sync_flavors
|
|
|
|
# Merge any duplicates that might have been created
|
|
echo "Cleaning up duplicates..."
|
|
python manage.py cleanup_duplicates
|
|
|
|
# Seed legacy flavors if needed
|
|
echo "Seeding legacy flavors..."
|
|
python manage.py seed_legacy_flavors
|
|
|
|
# Auto-sync banner models and settings from JSON files
|
|
echo "Syncing banner configurations..."
|
|
python manage.py seed_banners
|
|
|
|
# Start the server using Gunicorn
|
|
echo "Starting Gunicorn..."
|
|
exec gunicorn holy_backend.wsgi:application --bind 0.0.0.0:8000 --workers 3 --timeout 120
|