File size: 1,241 Bytes
5c9b605
 
 
 
 
 
 
 
 
f403cbc
5c9b605
f403cbc
 
 
 
 
 
 
5c9b605
 
f403cbc
 
 
 
 
 
5c9b605
 
 
f403cbc
e49dac2
f403cbc
5c9b605
 
 
 
f403cbc
 
 
5c9b605
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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"]