Drakkarious commited on
Commit
c68eaba
·
verified ·
1 Parent(s): 2af146c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -8
Dockerfile CHANGED
@@ -1,23 +1,29 @@
1
  FROM python:3.10-bookworm
2
 
3
- RUN apt-get update && apt-get install -y curl git procps && rm -rf /var/lib/apt/lists/*
 
 
 
4
 
 
5
  RUN useradd -m -u 1000 user
6
  ENV HOME=/home/user \
7
  PATH=/home/user/.local/bin:$PATH
8
  WORKDIR $HOME/app
9
 
 
10
  RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
11
  USER user
12
 
13
- # Install the specific pre-built wheel for CPU
14
- RUN pip install --no-cache-dir \
15
- https://github.com/mrzeeshanahmed/llama-cpp-python/releases/download/v0.3.17-manylinux-x86_64/llama_cpp_python-0.3.17-cp310-cp310-manylinux_2_17_x86_64.whl \
16
- huggingface-hub \
17
- hf-transfer \
18
- gradio
 
19
 
20
  COPY --chown=user . .
21
 
22
- # Run the app.py with unbuffered logs
23
  CMD ["python", "-u", "app.py"]
 
1
  FROM python:3.10-bookworm
2
 
3
+ # 1. Install system requirements
4
+ RUN apt-get update && apt-get install -y \
5
+ curl git procps libopenblas-dev \
6
+ && rm -rf /var/lib/apt/lists/*
7
 
8
+ # 2. Set up user (HF requires UID 1000)
9
  RUN useradd -m -u 1000 user
10
  ENV HOME=/home/user \
11
  PATH=/home/user/.local/bin:$PATH
12
  WORKDIR $HOME/app
13
 
14
+ # 3. Pre-create model directory
15
  RUN mkdir -p $HOME/app/model_cache && chown -R user:user $HOME/app
16
  USER user
17
 
18
+ # 4. Install Gradio first to establish the web server
19
+ RUN pip install --no-cache-dir gradio huggingface-hub hf-transfer numpy
20
+
21
+ # 5. Install llama-cpp-python using the OFFICIAL CPU INDEX
22
+ # This is safer than a random GitHub link as it auto-matches your OS
23
+ RUN pip install llama-cpp-python \
24
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
25
 
26
  COPY --chown=user . .
27
 
28
+ # Use -u for unbuffered logs (so you see the download progress)
29
  CMD ["python", "-u", "app.py"]