shaiwatcher/wrapper/dockerfile

28 lines
694 B
Plaintext

FROM python:3.11-slim
ARG WITH_PLAYWRIGHT=0
WORKDIR /app
# git + CA, and tools used by playwright bootstrap when enabled
RUN apt-get update && \
apt-get install -y --no-install-recommends git ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
# Faster, cleaner pip
RUN pip install --no-cache-dir pip setuptools wheel
# Optional Playwright (driven by build-arg)
ARG WITH_PLAYWRIGHT=0
RUN if [ "$WITH_PLAYWRIGHT" = "1" ]; then \
pip install --no-cache-dir playwright==1.45.0 && \
python -m playwright install --with-deps chromium ; \
fi
# Wrapper entrypoint
COPY start.sh /start.sh
COPY wrapper.py /app/wrapper.py
RUN chmod +x /start.sh
ENTRYPOINT ["/start.sh"]