31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
FROM python:3.11-slim
|
|
WORKDIR /app
|
|
|
|
# Base tools
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir pip setuptools wheel
|
|
|
|
# Playwright OS deps (Debian runtime libs for Chromium)
|
|
ARG WITH_PLAYWRIGHT=1
|
|
RUN if [ "$WITH_PLAYWRIGHT" = "1" ]; then \
|
|
set -eux; apt-get update && apt-get install -y --no-install-recommends \
|
|
libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdbus-1-3 \
|
|
libx11-xcb1 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
|
|
libgbm1 libgtk-3-0 libpango-1.0-0 libcairo2 libasound2 \
|
|
libdrm2 libxss1 libxshmfence1 libxext6 libxi6 libxkbcommon0 \
|
|
xdg-utils fonts-liberation wget \
|
|
&& rm -rf /var/lib/apt/lists/*; \
|
|
fi
|
|
|
|
# Wrapper deps (keep playwright here even if repo requirements don't list it)
|
|
RUN pip install --no-cache-dir playwright
|
|
|
|
# Wrapper files
|
|
COPY wrapper.py /app/wrapper.py
|
|
COPY start.sh /app/start.sh
|
|
RUN chmod +x /app/start.sh
|
|
|
|
ENTRYPOINT ["/app/start.sh"]
|