ramedde commited on
Commit
dd8e34d
·
verified ·
1 Parent(s): 1c3ea52

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -38
Dockerfile CHANGED
@@ -1,44 +1,17 @@
1
  FROM python:3.11-slim
2
-
3
- RUN apt-get update && apt-get install -y \
4
- git \
5
- git-lfs \
6
- ffmpeg \
7
- libsm6 \
8
- libxext6 \
9
- cmake \
10
- rsync \
11
- libgl1 \
12
- g++ \
13
- gcc \
14
- build-essential \
15
- wget \
16
- && rm -rf /var/lib/apt/lists/* \
17
- && git lfs install
18
-
19
  RUN useradd -m -u 1000 user
20
-
 
 
 
21
  WORKDIR /app
22
-
23
- ENV GRADIO_SERVER_NAME="0.0.0.0"
24
- ENV GRADIO_SERVER_PORT="7860"
25
-
26
- RUN pip install --no-cache-dir --upgrade pip
27
-
28
- # FIX: Use the correct general instruction model (Q4_K_M ≈ 350 MB)
29
- # Previously used Qwen2.5-Coder-0.5B-Instruct-F16.gguf (wrong model + ~1 GB)
30
- RUN wget -q --show-progress \
31
- "https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf" \
32
- -O /app/model.gguf && \
33
- echo "✅ Model size: $(du -sh /app/model.gguf)"
34
-
35
- COPY requirements.txt .
36
  RUN pip install --no-cache-dir -r requirements.txt
37
-
38
- COPY --chown=user:user . /app
39
-
40
- USER user
41
-
42
  EXPOSE 7860
43
-
44
  CMD ["python", "app.py"]
 
1
  FROM python:3.11-slim
2
+
3
+ # HF Spaces runs as UID 1000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
+
9
  WORKDIR /app
10
+
11
+ COPY --chown=user requirements.txt .
 
 
 
 
 
 
 
 
 
 
 
 
12
  RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ COPY --chown=user . .
15
+
 
 
16
  EXPOSE 7860
 
17
  CMD ["python", "app.py"]