ProfessorCEO commited on
Commit
373a99c
·
verified ·
1 Parent(s): 59201a2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -13
Dockerfile CHANGED
@@ -8,22 +8,19 @@ ENV HOME=/home/user \
8
 
9
  WORKDIR $HOME/app
10
 
11
- # 2. Install Heavy Compilers (The "Factory")
12
- USER root
13
- RUN apt-get update && apt-get install -y \
14
- build-essential \
15
- cmake \
16
- git \
17
- && rm -rf /var/lib/apt/lists/*
18
- USER user
19
 
20
- # 3. Install Python Dependencies
21
  COPY --chown=user requirements.txt requirements.txt
22
- RUN pip install --no-cache-dir --upgrade pip && \
 
23
  pip install --no-cache-dir -r requirements.txt
24
 
25
- # 4. Copy Application Code
26
  COPY --chown=user . .
27
-
28
- # 5. Launch the Librarian
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
8
 
9
  WORKDIR $HOME/app
10
 
11
+ # 2. BYPASS BUILD: Install the Pre-Compiled Engine
12
+ # We use a specific URL to get the "CPU Wheel" (Binary) directly.
13
+ # This takes 30 seconds instead of 30 minutes.
14
+ RUN pip install --no-cache-dir --upgrade pip && \
15
+ pip install llama-cpp-python \
16
+ --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
 
17
 
18
+ # 3. Install the Rest
19
  COPY --chown=user requirements.txt requirements.txt
20
+ # We remove llama-cpp-python from requirements so it doesn't try to rebuild it
21
+ RUN sed -i '/llama-cpp-python/d' requirements.txt && \
22
  pip install --no-cache-dir -r requirements.txt
23
 
24
+ # 4. Copy Code & Launch
25
  COPY --chown=user . .
 
 
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]