Soumik Bose commited on
Commit
2db14a9
·
1 Parent(s): 418f64b
Files changed (2) hide show
  1. Dockerfile +11 -8
  2. requirements.txt +0 -2
Dockerfile CHANGED
@@ -8,10 +8,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
8
 
9
  WORKDIR /app
10
 
11
- # Install build dependencies for llama-cpp-python
12
  RUN apt-get update && apt-get install -y \
13
- build-essential \
14
- cmake \
15
  curl \
16
  && rm -rf /var/lib/apt/lists/*
17
 
@@ -19,15 +17,20 @@ RUN apt-get update && apt-get install -y \
19
  RUN useradd -m -u 1000 user
20
  RUN mkdir -p /app/cache /app/models && chown -R user:user /app
21
 
22
- # Install pip as root first
 
 
 
 
 
23
  RUN pip install --no-cache-dir --upgrade pip
24
 
25
- USER user
 
26
 
27
- # Install dependencies
28
  COPY --chown=user:user requirements.txt .
29
- RUN CMAKE_ARGS="-DGGML_BLAS=OFF -DGGML_NATIVE=OFF" \
30
- pip install --no-cache-dir -r requirements.txt
31
 
32
  # Copy app
33
  COPY --chown=user:user main.py .
 
8
 
9
  WORKDIR /app
10
 
11
+ # Minimal dependencies
12
  RUN apt-get update && apt-get install -y \
 
 
13
  curl \
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
17
  RUN useradd -m -u 1000 user
18
  RUN mkdir -p /app/cache /app/models && chown -R user:user /app
19
 
20
+ USER user
21
+
22
+ # Copy the wheel file you downloaded
23
+ COPY --chown=user:user llama_cpp_python-0.3.16-cp310-cp310-manylinux_2_17_x86_64.whl /tmp/
24
+
25
+ # Install pip
26
  RUN pip install --no-cache-dir --upgrade pip
27
 
28
+ # Install the wheel directly
29
+ RUN pip install --no-cache-dir /tmp/llama_cpp_python-0.3.16-cp310-cp310-manylinux_2_17_x86_64.whl
30
 
31
+ # Install other dependencies
32
  COPY --chown=user:user requirements.txt .
33
+ RUN pip install --no-cache-dir -r requirements.txt
 
34
 
35
  # Copy app
36
  COPY --chown=user:user main.py .
requirements.txt CHANGED
@@ -1,5 +1,3 @@
1
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
2
- llama-cpp-python>=0.2.90
3
  fastapi>=0.115.0
4
  uvicorn>=0.30.0
5
  pydantic>=2.8.0
 
 
 
1
  fastapi>=0.115.0
2
  uvicorn>=0.30.0
3
  pydantic>=2.8.0