st192011 commited on
Commit
d3e123f
·
verified ·
1 Parent(s): 22df6a1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -8
Dockerfile CHANGED
@@ -1,20 +1,35 @@
1
  FROM python:3.10-slim
2
 
3
- # 1. Setup User 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 $HOME/app
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
- # 2. Install dependencies (This will use pre-built WHEELS - no compiling)
12
  RUN pip install --no-cache-dir \
13
- llama-cpp-python \
14
- huggingface_hub \
15
- gradio
 
 
 
 
16
 
17
- # 3. Copy app
18
- COPY --chown=user . .
19
 
20
  CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 1. Setup User 1000 (Required for HF Spaces)
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV HOME=/home/user \
7
  PATH=/home/user/.local/bin:$PATH
8
 
9
+ FROM python:3.10-slim
10
+
11
+ FROM python:3.10-slim
12
+
13
+ # 1. System dependencies
14
+ RUN apt-get update && apt-get install -y \
15
+ git \
16
+ build-essential \
17
+ cmake \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # 2. Install llama-cpp-python with CPU-only flags
21
+ ENV CMAKE_ARGS="-DLLAMA_NATIVE=OFF"
22
+ ENV FORCE_CMAKE=1
23
 
 
24
  RUN pip install --no-cache-dir \
25
+ llama-cpp-python==0.2.90
26
+
27
+ # 3. App setup
28
+ WORKDIR /app
29
+
30
+ COPY requirements.txt .
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
 
33
+ COPY . .
 
34
 
35
  CMD ["python", "app.py"]