amitbhatt6075 commited on
Commit
3e2ca02
·
1 Parent(s): b88fafc

Final Deploy: Swapped wheel source to generic linux AVX2

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -1,37 +1,38 @@
1
- # Base Image
2
  FROM python:3.11
3
 
4
- # Set Working Directory
5
  WORKDIR /app
6
 
7
- # System tools install karo
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
10
  cmake \
11
  libgl1 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # === MAGIC FIX ===
15
- # Hum pip ko upgrade karke batayenge ki sirf Binary (bana-banaya) chahiye.
16
- # Hum version v0.2.90 use kar rahe hain jo sabse stable hai free servers ke liye.
 
17
  RUN pip install --upgrade pip && \
18
  pip install llama-cpp-python==0.2.90 \
19
- --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
20
  --prefer-binary \
21
  --no-cache-dir
22
 
23
- # Baaki requirements copy karo aur install karo
24
  COPY requirements.txt .
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
- # Copy Code
28
  COPY . .
29
 
30
- # Permissions set karo
31
  RUN chmod -R 777 /app
32
 
33
- # Expose Port
34
  EXPOSE 7860
35
 
36
- # Run Server
37
  CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Start with Python 3.11
2
  FROM python:3.11
3
 
4
+ # Working Directory Setup
5
  WORKDIR /app
6
 
7
+ # Install basic tools (Quick step)
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  build-essential \
10
  cmake \
11
  libgl1 \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
+ # === 🛡️ THE FINAL FIX: CORRECT WHEEL INSTALL ===
15
+ # Ye link (jllllll/AVX2/cpu) specially HF jaise servers ke liye hai.
16
+ # 1. Compile nahi karega (Fast install).
17
+ # 2. 'manylinux' wheel uthayega (No 'musl' error crash).
18
  RUN pip install --upgrade pip && \
19
  pip install llama-cpp-python==0.2.90 \
20
+ --extra-index-url https://jllllll.github.io/llama-cpp-python-cuBLAS-wheels/AVX2/cpu \
21
  --prefer-binary \
22
  --no-cache-dir
23
 
24
+ # Install remaining dependencies from requirements.txt
25
  COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
+ # Copy App Code
29
  COPY . .
30
 
31
+ # Set Permissions
32
  RUN chmod -R 777 /app
33
 
34
+ # Open Port
35
  EXPOSE 7860
36
 
37
+ # Launch
38
  CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]