openfree commited on
Commit
1b8037f
·
verified ·
1 Parent(s): c26dde7

Upload Dockerfile (1)

Browse files
Files changed (1) hide show
  1. Dockerfile (1) +32 -0
Dockerfile (1) ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ cmake \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Set environment variable for HF cache
11
+ ENV HF_HOME=/tmp/huggingface_cache
12
+
13
+ # Clone llama.cpp
14
+ RUN git clone https://github.com/ggerganov/llama.cpp /app/llama.cpp
15
+
16
+ # Build llama.cpp
17
+ WORKDIR /app/llama.cpp
18
+ RUN mkdir -p build && cd build && cmake .. && make
19
+
20
+ # Set up Python environment
21
+ WORKDIR /app
22
+ COPY requirements.txt .
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy your app code
26
+ COPY . .
27
+
28
+ # Ensure the cache directory exists
29
+ RUN mkdir -p $HF_HOME && chmod -R 777 $HF_HOME
30
+
31
+ # Set the entrypoint
32
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]