Просмотр исходного кода

Add Xvfb virtual display for headed Playwright in Docker

Installs xvfb and starts a virtual framebuffer on :99 before any service
mode, so Playwright can run headed (bypassing Cloudflare/WAF) without a
real display.
ZiB 4 месяцев назад
Родитель
Сommit
37f8d8fb41
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 1
      docker/Dockerfile
  2. 3 0
      docker/entrypoint.sh

+ 1 - 1
docker/Dockerfile

@@ -4,7 +4,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
 
 # Node.js 22 LTS
 RUN apt-get update \
-    && apt-get install -y --no-install-recommends ca-certificates curl tini \
+    && apt-get install -y --no-install-recommends ca-certificates curl tini xvfb \
     && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
     && apt-get install -y --no-install-recommends nodejs \
     && rm -rf /var/lib/apt/lists/*

+ 3 - 0
docker/entrypoint.sh

@@ -17,6 +17,9 @@ if [ -z "$ROOM_CAL_API_URL" ] && [ -f "$ROOM_CAL_DATA_HOME/config.json" ]; then
 fi
 export ROOM_CAL_API_URL
 
+Xvfb :99 -screen 0 1280x720x24 -ac &
+export DISPLAY=:99
+
 SERVICE="${1:-api}"
 
 # MCP