Bundle patched ChromeDriver in Docker image
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user