Spaces:
Running
Running
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONIOENCODING=utf-8 \ | |
| PORT=7860 | |
| WORKDIR /app | |
| # Install system dependencies + Chrome/Chromium for AI-Search-Hub | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends \ | |
| gcc g++ curl git \ | |
| chromium chromium-driver \ | |
| libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 \ | |
| libxcomposite1 libxdamage1 libxrandr2 libgbm1 \ | |
| libasound2 libpangocairo-1.0-0 libgtk-3-0 \ | |
| libxshmfence1 libx11-xcb1 fonts-liberation \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Tell Playwright and the script where to find Chromium | |
| ENV CHROME_BIN=/usr/bin/chromium \ | |
| PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium \ | |
| AI_SEARCH_HUB_REPO_PATH=/app/AI-Search-Hub | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install AI-Search-Hub | |
| RUN git clone --depth 1 https://github.com/minsight-ai-info/AI-Search-Hub /app/AI-Search-Hub | |
| COPY app ./app | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ | |
| CMD curl -f http://localhost:7860/health || exit 1 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |