Update wrapper/dockerfile
Added playwright and chromium for data scraping, and simplified env designation
This commit is contained in:
parent
1f09990bd4
commit
8e91927057
@ -1,17 +1,26 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
ARG WITH_PLAYWRIGHT=0
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install git + certs for HTTPS
|
# git + CA, and tools used by playwright bootstrap when enabled
|
||||||
RUN apt-get update && \
|
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/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Optional: speed up pip
|
# Faster, cleaner pip
|
||||||
RUN pip install --no-cache-dir pip setuptools wheel
|
RUN pip install --no-cache-dir pip setuptools wheel
|
||||||
|
|
||||||
# Copy only the wrapper scripts (NOT the bot repo)
|
# Optional: bake Playwright in (pass --build-arg WITH_PLAYWRIGHT=1)
|
||||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
RUN if [ "$WITH_PLAYWRIGHT" = "1" ]; then \
|
||||||
RUN chmod +x /app/docker-entrypoint.sh
|
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"]
|
||||||
|
Loading…
Reference in New Issue
Block a user