broadfield-dev commited on
Commit
dc35602
·
verified ·
1 Parent(s): 916de11

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -14
Dockerfile CHANGED
@@ -1,9 +1,6 @@
1
  # Use a standard Python base image
2
  FROM python:3.10-slim
3
 
4
- # Set the working directory inside the container
5
- WORKDIR /code
6
-
7
  # Install system dependencies needed for git, building C++ code, and curl
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  git \
@@ -12,18 +9,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
12
  libcurl4-openssl-dev \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Clone the llama.cpp repository
16
- RUN git clone https://github.com/ggerganov/llama.cpp.git
17
-
18
- # Install Python dependencies for llama.cpp first
19
- RUN pip install --no-cache-dir -r llama.cpp/requirements.txt
20
-
21
- # Build the llama.cpp binaries
22
- WORKDIR /code/llama.cpp
23
- RUN cmake .
24
- RUN cmake --build .
25
 
26
- # Go back to the root directory
27
  WORKDIR /code
28
 
29
  # Copy your application's requirements.txt and install its dependencies
 
1
  # Use a standard Python base image
2
  FROM python:3.10-slim
3
 
 
 
 
4
  # Install system dependencies needed for git, building C++ code, and curl
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  git \
 
9
  libcurl4-openssl-dev \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Clone and build llama.cpp in /opt, completely separate from the app code
13
+ RUN git clone https://github.com/ggerganov/llama.cpp.git /opt/llama.cpp
14
+ WORKDIR /opt/llama.cpp
15
+ # Use an out-of-source build, which is cleaner
16
+ RUN cmake -B build .
17
+ RUN cmake --build build
 
 
 
 
18
 
19
+ # Set up the application directory
20
  WORKDIR /code
21
 
22
  # Copy your application's requirements.txt and install its dependencies