quantumbit commited on
Commit
4013785
·
verified ·
1 Parent(s): a164bf9

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -20
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.11-slim
2
 
3
  # HuggingFace Spaces runs as a non-root user; port 7860 is the default
4
  ENV PORT=7860
@@ -7,32 +7,27 @@ ENV PYTHONDONTWRITEBYTECODE=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
- # Note: Redis Stack packages live under the redis-stack apt repo.
21
- RUN set -eux; \
22
- curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg; \
23
- echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/redis-stack/deb bookworm main" \
24
- > /etc/apt/sources.list.d/redis-stack.list; \
25
- apt-get update; \
26
- apt-get install -y --no-install-recommends redis-stack-server; \
27
- rm -rf /var/lib/apt/lists/*
28
 
29
  COPY requirements.txt .
30
- RUN pip install --no-cache-dir -r requirements.txt
31
 
32
  COPY . .
33
 
34
  # FAISS index dir (ephemeral per session — wiped on container restart)
35
- RUN mkdir -p /app/faiss_indexes /app/context
 
36
 
37
  ENV REDIS_URL=redis://localhost:6379
38
  ENV CACHE_ENABLED=true
 
1
+ FROM redis/redis-stack-server:latest
2
 
3
  # HuggingFace Spaces runs as a non-root user; port 7860 is the default
4
  ENV PORT=7860
 
7
 
8
  WORKDIR /app
9
 
10
+ USER root
11
+
12
+ # System deps for PyPDF + Python runtime
13
  RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ python3 \
15
+ python3-pip \
16
+ python3-venv \
17
+ build-essential \
18
+ libgomp1 \
19
+ ca-certificates \
20
+ curl \
21
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
22
 
23
  COPY requirements.txt .
24
+ RUN python3 -m pip install --no-cache-dir -r requirements.txt
25
 
26
  COPY . .
27
 
28
  # FAISS index dir (ephemeral per session — wiped on container restart)
29
+ RUN mkdir -p /app/faiss_indexes /app/context \
30
+ && chmod -R 777 /app/faiss_indexes /app/context
31
 
32
  ENV REDIS_URL=redis://localhost:6379
33
  ENV CACHE_ENABLED=true