diff --git a/wrapper/docker-entrypoint.sh b/wrapper/docker-entrypoint.sh index 8e9c905..00693e0 100644 --- a/wrapper/docker-entrypoint.sh +++ b/wrapper/docker-entrypoint.sh @@ -33,6 +33,18 @@ if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt fi +# --- Playwright browser runtime (cached in /cache so it persists) --- +export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-/cache/pw-browsers}" +if python -c "import playwright" >/dev/null 2>&1; then + if [ ! -d "$PLAYWRIGHT_BROWSERS_PATH" ] || [ -z "$(ls -A "$PLAYWRIGHT_BROWSERS_PATH" 2>/dev/null)" ]; then + echo "[Wrapper] Installing Playwright Chromium to $PLAYWRIGHT_BROWSERS_PATH ..." + # try without OS deps first; if your base has them it’s faster + python -m playwright install chromium || python -m playwright install --with-deps chromium + else + echo "[Wrapper] Playwright browser cache present at $PLAYWRIGHT_BROWSERS_PATH" + fi +fi + # --- Export env for child (don’t quote, avoid stray quotes) --- export SHAI_CONFIG SHAI_DATA