devray11 commited on
Commit
5671570
·
verified ·
1 Parent(s): 4b3697a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -14
Dockerfile CHANGED
@@ -1,25 +1,19 @@
1
- FROM python:3.9-slim
 
2
 
3
- # 1. Install system tools needed to build C++ code
4
  RUN apt-get update && apt-get install -y \
5
- build-essential \
6
- cmake \
7
- python3-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
  WORKDIR /code
11
 
12
- # 2. Install requirements
13
  COPY ./requirements.txt /code/requirements.txt
14
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
15
-
16
- # 3. Build llama-cpp-python with specific CPU settings
17
- # This ensures it doesn't look for a GPU (which the free tier doesn't have)
18
- RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" \
19
- FORCE_CMAKE=1 \
20
- pip install llama-cpp-python --no-cache-dir
21
 
 
22
  COPY . .
23
 
24
- # 4. Start the server
25
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Python 3.10 to match our pre-built engine
2
+ FROM python:3.10-slim
3
 
4
+ # Install only the light-weight math library needed for inference
5
  RUN apt-get update && apt-get install -y \
6
+ libopenblas-dev \
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /code
10
 
11
+ # Install our requirements (this is now very fast)
12
  COPY ./requirements.txt /code/requirements.txt
13
+ RUN pip install --no-cache-dir -r /code/requirements.txt
 
 
 
 
 
 
14
 
15
+ # Copy your Python logic
16
  COPY . .
17
 
18
+ # Start the API on port 7860
19
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]