Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Install system dependencies for Playwright | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libxkbcommon0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| libasound2 \ | |
| libxshmfence1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install python packages and playwright | |
| RUN pip install --no-cache-dir playwright && playwright install chromium | |
| # App folder | |
| WORKDIR /app | |
| COPY . /app | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # HuggingFace requires port 7860 | |
| EXPOSE 7860 | |
| # Start FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |