mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
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
This commit is contained in:
parent
ff83d28eba
commit
6d797dc0d2
@ -19,7 +19,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
||||
FROM python:3.12-slim AS runtime
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libpq5 curl tini \
|
||||
libpq5 curl tini libxml2 libxslt1.1 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN groupadd --gid 1000 app \
|
||||
@ -38,7 +38,7 @@ USER app
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=5 \
|
||||
HEALTHCHECK --interval=20s --timeout=15s --start-period=120s --retries=5 \
|
||||
CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
|
||||
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
|
||||
@ -139,7 +139,7 @@ def apply_patch():
|
||||
import sys
|
||||
import types
|
||||
db_url = _get_db_url()
|
||||
if "sqlite" in db_url.lower():
|
||||
if not db_url or "sqlite" in db_url.lower():
|
||||
# Patch PostgreSQL dialect
|
||||
sys.modules["sqlalchemy.dialects.postgresql"] = _FakePGModule() # type: ignore
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user