broadfield-dev commited on
Commit
16fb5fb
·
verified ·
1 Parent(s): 97b9b15

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -0
Dockerfile ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 and building C++ code
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ git \
10
+ build-essential \
11
+ cmake \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Clone the llama.cpp repository
15
+ RUN git clone https://github.com/ggerganov/llama.cpp.git
16
+
17
+ # Install Python dependencies for llama.cpp first
18
+ RUN pip install --no-cache-dir -r llama.cpp/requirements.txt
19
+
20
+ # Build the llama.cpp binaries
21
+ WORKDIR /code/llama.cpp
22
+ RUN cmake .
23
+ RUN cmake --build .
24
+
25
+ # Go back to the root directory
26
+ WORKDIR /code
27
+
28
+ # Copy your application's requirements.txt and install its dependencies
29
+ COPY requirements.txt .
30
+ RUN pip install --no-cache-dir -r requirements.txt
31
+
32
+ # Copy the rest of your application files
33
+ COPY . .
34
+
35
+ # Expose the port Gradio runs on
36
+ EXPOSE 7860
37
+
38
+ # The command to run your application
39
+ CMD ["python", "app.py"]