| | |
| | FROM python:3.9-slim |
| |
|
| | ENV DEBIAN_FRONTEND=noninteractive |
| | ENV CHROME_BIN=/usr/bin/google-chrome-stable |
| | WORKDIR /app |
| |
|
| | |
| | RUN apt-get update \ |
| | && apt-get install -y --no-install-recommends \ |
| | ca-certificates \ |
| | wget \ |
| | gnupg \ |
| | unzip \ |
| | xvfb \ |
| | x11-utils \ |
| | fonts-liberation \ |
| | libnss3 \ |
| | libxss1 \ |
| | libasound2 \ |
| | libatk1.0-0 \ |
| | libatk-bridge2.0-0 \ |
| | libcups2 \ |
| | libx11-xcb1 \ |
| | libxcomposite1 \ |
| | libxdamage1 \ |
| | libxrandr2 \ |
| | libgbm1 \ |
| | xdg-utils \ |
| | libxrender1 \ |
| | libxext6 \ |
| | libxshmfence1 \ |
| | libglib2.0-0 \ |
| | libdbus-1-3 \ |
| | libdrm2 \ |
| | && rm -rf /var/lib/apt/lists/* |
| |
|
| | |
| | RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub \ |
| | | gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg \ |
| | && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" \ |
| | > /etc/apt/sources.list.d/google-chrome.list \ |
| | && apt-get update \ |
| | && apt-get install -y --no-install-recommends google-chrome-stable \ |
| | && rm -rf /var/lib/apt/lists/* |
| |
|
| | |
| | COPY requirements.txt /app/requirements.txt |
| | RUN pip install --no-cache-dir --upgrade pip \ |
| | && pip install --no-cache-dir -r /app/requirements.txt |
| |
|
| | |
| | RUN python -m playwright install --with-deps chromium |
| |
|
| | |
| | COPY . /app |
| |
|
| | |
| | EXPOSE 7860 |
| |
|
| | |
| | CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |