Lachowskii commited on
Commit
1ec1b7d
·
verified ·
1 Parent(s): 60688b3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -8
Dockerfile CHANGED
@@ -1,23 +1,30 @@
1
  FROM python:3.10
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  build-essential \
5
- cmake \
6
- ninja-build \
7
  git \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- RUN pip install --upgrade pip
11
 
12
- RUN pip install \
 
13
  fastapi \
14
  uvicorn \
15
- huggingface_hub
 
16
 
17
- # install llama-cpp-python WITH prebuilt flag
18
- RUN pip install llama-cpp-python --no-cache-dir --force-reinstall
 
 
19
 
 
20
  WORKDIR /app
21
- COPY app.py /app.py
22
 
 
 
 
 
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10
2
 
3
+ # Minimal system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
 
 
6
  git \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ RUN pip install --no-cache-dir --upgrade pip
10
 
11
+ # Install regular dependencies
12
+ RUN pip install --no-cache-dir \
13
  fastapi \
14
  uvicorn \
15
+ huggingface_hub \
16
+ pydantic
17
 
18
+ # Install PRE-COMPILED llama-cpp-python for CPU
19
+ # This prevents the "Job timeout" by skipping the build phase
20
+ RUN pip install llama-cpp-python \
21
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
22
 
23
+ # Set working directory
24
  WORKDIR /app
 
25
 
26
+ # Copy your application code
27
+ COPY app.py .
28
+
29
+ # Run the API
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]