Spaces:
Sleeping
Sleeping
FROM python:3.10-slim | |
# Install system dependencies required by Playwright | |
RUN apt-get update && apt-get install -y wget curl gnupg unzip \ | |
libglib2.0-0 libnss3 libgconf-2-4 libfontconfig1 libxss1 \ | |
libasound2 libxtst6 libx11-xcb1 libxcomposite1 libxcursor1 \ | |
libxdamage1 libxrandr2 libxext6 libxfixes3 libx11-6 libxcb1 \ | |
libxinerama1 libpango-1.0-0 libcairo2 libatk-bridge2.0-0 libgtk-3-0 | |
# Install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Install Playwright and Chromium browser (CRITICAL) | |
RUN playwright install chromium | |
# Copy app code | |
COPY . /app | |
WORKDIR /app | |
# Start the FastAPI server | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |