Bundle patched ChromeDriver in Docker image

This commit is contained in:
2026-07-28 22:00:19 +03:30
parent 3f180e88ed
commit 4462990d6f
2 changed files with 15 additions and 3 deletions
+4 -1
View File
@@ -42,6 +42,7 @@ ENV PATH="/app/.venv/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
# Tell undetected-chromedriver where Chrome lives
CHROME_BINARY=/usr/bin/google-chrome-stable \
CHROMEDRIVER_PATH=/app/drivers/chromedriver \
# Always run headless inside Docker
HEADLESS=true
@@ -51,7 +52,9 @@ COPY . .
# Copy this after the application so a host venv can never replace it.
COPY --from=builder /app/.venv /app/.venv
RUN mkdir -p data logs
# Download and patch the matching driver at build time. Runtime jobs must not
# depend on undetected-chromedriver's network downloader.
RUN PYTHONPATH=. python scripts/patch_driver.py && mkdir -p data logs
# Non-root user for safety
RUN useradd -m -u 1001 seed && chown -R seed:seed /app