From 448b4866724c72edd14b468e308ede79b72251d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C9=A7=CF=83=E2=84=93=CF=83?= Date: Fri, 13 Feb 2026 16:03:49 +0100 Subject: [PATCH] feat: add explicit Chrome installation and pre-download chromedriver in Docker build --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4796168..9ede13c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM python:3.12-slim +FROM --platform=linux/amd64 python:3.12-slim COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -# Install system dependencies for Chrome / SeleniumBase +# Install system dependencies + Google Chrome RUN apt-get update && apt-get install -y --no-install-recommends \ wget \ gnupg2 \ @@ -23,6 +23,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libxdamage1 \ libxrandr2 \ xdg-utils \ + && wget -q -O /tmp/google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && apt-get install -y --no-install-recommends /tmp/google-chrome.deb \ + && rm /tmp/google-chrome.deb \ && rm -rf /var/lib/apt/lists/* WORKDIR /app @@ -40,6 +43,9 @@ COPY . /app RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --locked +# Pre-download chromedriver matching installed Chrome +RUN uv run python -c "from seleniumbase import Driver; d = Driver(uc=True, headless=True); d.quit()" + ENV HEADLESS_BROWSER=True ENV PORT=4001