File size: 834 Bytes
ba01a50
 
b774f53
ba01a50
 
 
 
 
 
 
 
b774f53
73594c1
 
 
 
5671570
be620bd
b774f53
6c27043
 
 
ba01a50
 
 
 
 
73594c1
ba01a50
 
6c27043
ba01a50
6c27043
 
ba01a50
4b0401f
 
ba01a50
6c27043
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Use a slightly more compatible base image
FROM python:3.10-slim

# Prevent Python from writing .pyc files
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# 🚀 Disable GPU build (CRITICAL FIX)
ENV CMAKE_ARGS="-DLLAMA_CUBLAS=off"

# Install only REQUIRED system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    make \
    cmake \
    libopenblas-dev \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /code

# Upgrade pip first (important for wheel resolution)
RUN pip install --upgrade pip

# Copy requirements
COPY requirements.txt .

# 🚀 Force binary install (KEY FIX)
RUN pip install --no-cache-dir --prefer-binary -r requirements.txt

# Copy app
COPY . .

# Hugging Face uses port 7860
EXPOSE 7860

# Start API
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]