File size: 1,746 Bytes
3379d24
6c24b50
3de9972
 
6c24b50
 
 
d688beb
6c24b50
 
d688beb
6c24b50
d688beb
 
 
 
273d53f
d688beb
6c24b50
 
 
 
 
 
 
 
 
d764ccd
6c24b50
 
974fbb9
7ccbc25
d688beb
 
 
 
6c24b50
 
4b54fab
3379d24
08919be
 
6c24b50
 
 
 
 
 
 
 
 
 
 
 
 
53067d9
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM python:3.11-slim

LABEL maintainer="AgentDeck-Backend"
LABEL description="AgentDeck-Backend"
LABEL version="1.0.0"

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    ffmpeg \
    git \
    libmagic1 \
    libxml2-dev \
    libxslt-dev \
    libffi-dev \
    libssl-dev \
    nodejs \
    zlib1g-dev \
    && rm -rf /var/lib/apt/lists/*

RUN groupadd --gid 1000 appuser && \
    useradd --uid 1000 --gid appuser --shell /bin/bash --create-home appuser

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu && \
    python -m spacy download en_core_web_sm

# SearXNG uses a rolling release model — master branch is the intended stable channel
RUN git clone --depth 1 --branch master https://github.com/searxng/searxng.git /tmp/searxng && \
    cd /tmp/searxng && \
    pip install --no-cache-dir --use-pep517 --no-build-isolation -e . && \
    rm -rf /tmp/searxng/.git

COPY --chown=appuser:appuser . .

RUN mkdir -p /app/models && python3 -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='ibm-granite/granite-embedding-small-english-r2', local_dir='/app/models/bge-384')" && chown -R appuser:appuser /app/models

RUN mkdir -p /app/data /app/logs && \
    chown -R appuser:appuser /app/data /app/logs

RUN chmod +x /app/start.sh

USER appuser

ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1

CMD ["/bin/bash", "/app/start.sh"]