quantumbit commited on
Commit
6d50ee2
·
verified ·
1 Parent(s): 6c0f23f

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -2
Dockerfile CHANGED
@@ -7,12 +7,24 @@ ENV PYTHONDONTWRITEBYTECODE=1
7
 
8
  WORKDIR /app
9
 
10
- # System deps for PyPDF and unstructured
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
12
  build-essential \
13
  libgomp1 \
 
 
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
 
 
 
 
 
 
 
 
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
@@ -21,6 +33,9 @@ COPY . .
21
  # FAISS index dir (ephemeral per session — wiped on container restart)
22
  RUN mkdir -p /app/faiss_indexes /app/context
23
 
 
 
 
24
  EXPOSE ${PORT}
25
 
26
- CMD uvicorn rag_system.api:app --host 0.0.0.0 --port ${PORT} --workers 1
 
7
 
8
  WORKDIR /app
9
 
10
+ # System deps for PyPDF + Redis Stack
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
12
  build-essential \
13
  libgomp1 \
14
+ ca-certificates \
15
+ curl \
16
+ gnupg \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Redis Stack (for vector search)
20
+ RUN set -eux; \
21
+ curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg; \
22
+ echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(. /etc/os-release && echo $VERSION_CODENAME) main" \
23
+ > /etc/apt/sources.list.d/redis.list; \
24
+ apt-get update; \
25
+ apt-get install -y --no-install-recommends redis-stack-server; \
26
+ rm -rf /var/lib/apt/lists/*
27
+
28
  COPY requirements.txt .
29
  RUN pip install --no-cache-dir -r requirements.txt
30
 
 
33
  # FAISS index dir (ephemeral per session — wiped on container restart)
34
  RUN mkdir -p /app/faiss_indexes /app/context
35
 
36
+ ENV REDIS_URL=redis://localhost:6379
37
+ ENV CACHE_ENABLED=true
38
+
39
  EXPOSE ${PORT}
40
 
41
+ CMD ["/bin/sh", "-c", "redis-stack-server --save '' --appendonly no & uvicorn rag_system.api:app --host 0.0.0.0 --port ${PORT} --workers 1"]