From 8e9192705734a298ea0a1dedf83d1629b6baa19c Mon Sep 17 00:00:00 2001 From: frarol96 Date: Sat, 16 Aug 2025 04:58:49 +0000 Subject: [PATCH] Update wrapper/dockerfile Added playwright and chromium for data scraping, and simplified env designation --- wrapper/dockerfile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/wrapper/dockerfile b/wrapper/dockerfile index 02d641d..56d76d0 100644 --- a/wrapper/dockerfile +++ b/wrapper/dockerfile @@ -1,17 +1,26 @@ FROM python:3.11-slim +ARG WITH_PLAYWRIGHT=0 + WORKDIR /app -# Install git + certs for HTTPS +# git + CA, and tools used by playwright bootstrap when enabled RUN apt-get update && \ - apt-get install -y --no-install-recommends git ca-certificates && \ + apt-get install -y --no-install-recommends git ca-certificates curl && \ rm -rf /var/lib/apt/lists/* -# Optional: speed up pip +# Faster, cleaner pip RUN pip install --no-cache-dir pip setuptools wheel -# Copy only the wrapper scripts (NOT the bot repo) -COPY docker-entrypoint.sh /app/docker-entrypoint.sh -RUN chmod +x /app/docker-entrypoint.sh +# Optional: bake Playwright in (pass --build-arg WITH_PLAYWRIGHT=1) +RUN if [ "$WITH_PLAYWRIGHT" = "1" ]; then \ + pip install --no-cache-dir playwright && \ + python -m playwright install --with-deps chromium; \ + fi -ENTRYPOINT ["/app/docker-entrypoint.sh"] +# Wrapper entrypoint +COPY start.sh /start.sh +COPY wrapper.py /app/wrapper.py +RUN chmod +x /start.sh + +ENTRYPOINT ["/start.sh"]