Update wrapper/dockerfile

Added playwright and chromium for data scraping, and simplified env designation
This commit is contained in:
frarol96 2025-08-16 04:58:49 +00:00
parent 1f09990bd4
commit 8e91927057

View File

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