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"]