File size: 1,077 Bytes
f4e3263
d4a141c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f4e3263
 
 
 
d4a141c
 
 
f4e3263
d4a141c
 
 
 
 
f4e3263
 
 
 
d4a141c
 
 
 
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
FROM python:3.11-slim

RUN useradd -m -u 1000 user

ENV HOME=/home/user
ENV PATH=/home/user/.local/bin:$PATH
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

WORKDIR $HOME/app

RUN apt-get update && apt-get install -y --no-install-recommends build-essential curl git && rm -rf /var/lib/apt/lists/*

COPY --chown=user requirements.txt $HOME/app/requirements.txt

RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

COPY --chown=user . $HOME/app

RUN mkdir -p /tmp/graphrag/uploads /tmp/graphrag/processed /tmp/graphrag/qdrant /tmp/graphrag/evaluation
RUN chown -R user:user /tmp/graphrag
RUN chown -R user:user $HOME/app

USER user

ENV PORT=7860

ENV LLM_PROVIDER=huggingface
ENV ENABLE_LOCAL_LLM=false
ENV HF_INFERENCE_MODEL=google/flan-t5-base
ENV HF_TIMEOUT_SECONDS=60

ENV UPLOAD_DIR=/tmp/graphrag/uploads
ENV PROCESSED_DIR=/tmp/graphrag/processed
ENV QDRANT_LOCAL_PATH=/tmp/graphrag/qdrant
ENV EVALUATION_DIR=/tmp/graphrag/evaluation

EXPOSE 7860

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]