Ashanasri commited on
Commit
d7cc23d
·
verified ·
1 Parent(s): 98bae45

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -13
Dockerfile CHANGED
@@ -29,36 +29,39 @@
29
  # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
30
 
31
 
32
-
33
  FROM python:3.11-slim
34
 
35
  # System dependencies
36
  RUN apt-get update && apt-get install -y \
37
  gcc \
38
  g++ \
39
- build-essential \
 
40
  && rm -rf /var/lib/apt/lists/*
41
 
42
  WORKDIR /app
43
 
44
- # Install llama-cpp-python FIRST (CPU prebuilt wheel)
 
45
  RUN pip install --no-cache-dir \
46
- llama-cpp-python==0.2.90 \
47
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
48
- --prefer-binary
49
 
50
- # Copy requirements
51
- COPY requirements.txt .
 
 
52
 
53
- # Install remaining dependencies
54
  RUN pip install --no-cache-dir -r requirements.txt
55
 
56
- # Copy application
57
  COPY app/ ./app/
58
 
59
- # Create needed folders
60
- RUN mkdir -p /app/data /app/models
61
 
62
  EXPOSE 7860
63
 
64
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
29
  # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
30
 
31
 
 
32
  FROM python:3.11-slim
33
 
34
  # System dependencies
35
  RUN apt-get update && apt-get install -y \
36
  gcc \
37
  g++ \
38
+ cmake \
39
+ libgomp1 \
40
  && rm -rf /var/lib/apt/lists/*
41
 
42
  WORKDIR /app
43
 
44
+ # Install llama-cpp-python kutoka PyPI moja kwa moja (glibc compatible)
45
+ # --prefer-binary inachukua pre-built wheel ya glibc, si musl
46
  RUN pip install --no-cache-dir \
47
+ "llama-cpp-python==0.2.90" \
48
+ --prefer-binary \
49
+ --no-deps
50
 
51
+ # Install dependencies zingine
52
+ RUN pip install --no-cache-dir \
53
+ diskcache \
54
+ numpy
55
 
56
+ COPY requirements.txt .
57
  RUN pip install --no-cache-dir -r requirements.txt
58
 
59
+ # Copy code
60
  COPY app/ ./app/
61
 
62
+ # Tengeneza folders
63
+ RUN mkdir -p ./data ./models
64
 
65
  EXPOSE 7860
66
 
67
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]