Spaces:
Running
Running
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| fonts-liberation \ | |
| fonts-liberation2 \ | |
| fonts-noto-color-emoji \ | |
| fonts-noto-cjk \ | |
| libfontconfig1 \ | |
| libfreetype6 \ | |
| libnss3 \ | |
| libnspr4 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxkbcommon0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| libasound2 \ | |
| libatspi2.0-0 \ | |
| libxshmfence1 \ | |
| libglib2.0-0 \ | |
| libdbus-1-3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first for better caching | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install Playwright browsers | |
| RUN playwright install chromium firefox | |
| RUN playwright install-deps chromium firefox || true | |
| # Copy application code | |
| COPY . . | |
| # Expose port | |
| EXPOSE 7860 | |
| # Set environment variables | |
| ENV GRADIO_SERVER_NAME="0.0.0.0" | |
| ENV GRADIO_SERVER_PORT=7860 | |
| # Run the application | |
| CMD ["python", "app.py"] | |