Spaces:
Running
Running
FROM python:3.10-slim | |
WORKDIR /app | |
# Install system dependencies for Playwright/Chromium | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
libnss3 \ | |
libnspr4 \ | |
libatk1.0-0 \ | |
libatk-bridge2.0-0 \ | |
libcups2 \ | |
libdrm2 \ | |
libxkbcommon0 \ | |
libxcomposite1 \ | |
libxdamage1 \ | |
libxfixes3 \ | |
libxrandr2 \ | |
libgbm1 \ | |
libasound2 \ | |
libpango-1.0-0 \ | |
libcairo2 \ | |
libpangocairo-1.0-0 \ | |
libjpeg62-turbo \ | |
libwoff1 \ | |
libharfbuzz0b \ | |
fonts-liberation \ | |
xvfb \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Set Playwright browsers path to a writable location | |
ENV PLAYWRIGHT_BROWSERS_PATH=/app/.cache/playwright | |
RUN mkdir -p /app/.cache/playwright && \ | |
chown -R root:root /app/.cache/playwright && \ | |
playwright install chromium | |
COPY . . | |
CMD ["python", "app.py"] |