File size: 668 Bytes
faebf07
 
 
4d1ec4d
 
 
 
 
 
 
 
 
 
 
 
faebf07
 
4d1ec4d
faebf07
4d1ec4d
 
 
faebf07
4d1ec4d
 
 
faebf07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
set -euo pipefail

log() {
  echo "[ENTRYPOINT] $1"
}

log "Boot sequence started at $(date -u +"%Y-%m-%d %H:%M:%S UTC")"

if [[ -z "${DATABASE_URL:-}" ]]; then
  log "DATABASE_URL is empty -> Django will fallback to POSTGRES_* or SQLite"
else
  log "DATABASE_URL detected (length: ${#DATABASE_URL})"
fi

cd /app

log "Running migrations..."
python hue_portal/manage.py migrate --noinput
log "Migrations completed."

log "Ensuring cache table exists..."
python hue_portal/manage.py createcachetable
log "Cache table ready."

log "Starting Gunicorn on port ${PORT:-7860}..."
exec gunicorn hue_portal.hue_portal.wsgi:application --bind 0.0.0.0:${PORT:-7860}