devray11 commited on
Commit
ba01a50
·
verified ·
1 Parent(s): 6230b4e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -8
Dockerfile CHANGED
@@ -1,7 +1,14 @@
1
- # Use Python 3.10 on Debian Bookworm
2
- FROM python:3.10-slim-bookworm
3
 
4
- # Install the COMPILERS and math libraries (Fixes your g++ error)
 
 
 
 
 
 
 
5
  RUN apt-get update && apt-get install -y \
6
  gcc \
7
  g++ \
@@ -13,15 +20,20 @@ RUN apt-get update && apt-get install -y \
13
 
14
  WORKDIR /code
15
 
16
- # Copy and install requirements
17
- COPY ./requirements.txt /code/requirements.txt
 
 
 
18
 
19
- # We force pip to look for the pre-built CPU wheel first
20
- RUN pip install --no-cache-dir -r /code/requirements.txt
21
 
 
22
  COPY . .
23
 
24
- # Expose the port for Hugging Face
25
  EXPOSE 7860
26
 
 
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a slightly more compatible base image
2
+ FROM python:3.10-slim
3
 
4
+ # Prevent Python from writing .pyc files
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # 🚀 Disable GPU build (CRITICAL FIX)
9
+ ENV CMAKE_ARGS="-DLLAMA_CUBLAS=off"
10
+
11
+ # Install only REQUIRED system dependencies
12
  RUN apt-get update && apt-get install -y \
13
  gcc \
14
  g++ \
 
20
 
21
  WORKDIR /code
22
 
23
+ # Upgrade pip first (important for wheel resolution)
24
+ RUN pip install --upgrade pip
25
+
26
+ # Copy requirements
27
+ COPY requirements.txt .
28
 
29
+ # 🚀 Force binary install (KEY FIX)
30
+ RUN pip install --no-cache-dir --prefer-binary -r requirements.txt
31
 
32
+ # Copy app
33
  COPY . .
34
 
35
+ # Hugging Face uses port 7860
36
  EXPOSE 7860
37
 
38
+ # Start API
39
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]