system-prompts-and-models-o.../salesflow-saas/backend/start.sh
Claude 6d797dc0d2
fix: root cause — sqlite_patch not applied when DATABASE_URL empty
Root cause: sqlite_patch checked `if "sqlite" in db_url` but db_url
was empty string when DATABASE_URL env var not set. Patch was skipped,
then models used PostgreSQL types (JSONB/Vector) with SQLite compiler
causing crash: "can't render element of type JSONB".

Fix: `if not db_url or "sqlite" in db_url` — apply patch when URL
is empty (defaults to SQLite anyway in database.py).

Also:
- Dockerfile: add libxml2/libxslt1.1 for lxml runtime
- Dockerfile: increase healthcheck start-period to 120s
- start.sh: log DATABASE_URL prefix for debugging

https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
2026-04-26 01:16:57 +00:00

18 lines
547 B
Bash
Executable File

#!/bin/sh
set -e
echo "[dealix] PORT=$PORT"
echo "[dealix] DATABASE_URL prefix: $(echo ${DATABASE_URL:-NOT_SET} | cut -d: -f1)"
echo "[dealix] Testing imports..."
python3 -c "
try:
from app.main import app
print(f'[dealix] OK — {len(app.routes)} routes')
except Exception as e:
print(f'[dealix] IMPORT FAILED: {e}')
import traceback
traceback.print_exc()
exit(1)
" 2>&1
echo "[dealix] Starting uvicorn on port ${PORT:-8000}..."
exec uvicorn app.main:app --host 0.0.0.0 --port "${PORT:-8000}" --workers 1 --log-level info