Spaces:
Running on Zero
Running on Zero
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Install only essential dependencies that definitely exist in Debian Trixie | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| gnupg \ | |
| curl \ | |
| libnss3 \ | |
| libatk-bridge2.0-0 \ | |
| libx11-6 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxext6 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libxss1 \ | |
| libasound2 \ | |
| libgtk-3-0 \ | |
| libgbm1 \ | |
| libcups2 \ | |
| libdbus-1-3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN pip install playwright==1.46.0 | |
| RUN playwright install --with-deps chromium | |
| # Install Playwright with minimal dependencies | |
| RUN playwright install chromium | |
| # Copy application files | |
| COPY . /app | |
| WORKDIR /app | |
| RUN pip install -r requirements.txt | |
| # Create necessary directories | |
| RUN mkdir -p /tmp | |
| # Expose port | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| # Start the application | |
| CMD ["python","app.py","uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |