Switch Playwright to headless — Xvfb fails on Proxmox LXC kernels

Xvfb exits immediately on the production LXC (no framebuffer device
support), so headed mode was never working. Switch to headless=True
and remove Xvfb from the Dockerfile entirely.

Stealth coverage is unchanged: playwright-stealth patches webdriver,
plugins and chrome.runtime; the residential proxy + sticky session
provide the GB residential fingerprint; homepage warmup carries real
session cookies into the search. --enable-unsafe-swiftshader and
--disable-blink-features=AutomationControlled are kept.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-09 17:01:54 +00:00
parent e781b1e8b9
commit 617ff932bb
2 changed files with 7 additions and 10 deletions

View file

@ -7,7 +7,6 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
postgresql-client \
curl \
xvfb \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
@ -20,9 +19,4 @@ COPY . .
EXPOSE 8000
# Run under a virtual X display so Chromium launches headful (headful fingerprints
# far cleaner than headless — real GPU strings, plugins, chrome.runtime).
# Start Xvfb directly rather than via xvfb-run: as container PID 1, xvfb-run's
# SIGUSR1 readiness handshake never fires and it hangs without exec'ing the app.
ENV DISPLAY=:99
CMD ["/bin/sh", "-c", "Xvfb :99 -screen 0 1920x1080x24 -nolisten tcp & sleep 1; exec uvicorn main:app --host 0.0.0.0 --port 8000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]