owlninjam commited on
Commit
8c1dd8c
·
verified ·
1 Parent(s): e366f1f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -19
Dockerfile CHANGED
@@ -1,31 +1,30 @@
1
- FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install dependencies for building llama.cpp with HTTP server support
6
  RUN apt-get update && apt-get install -y \
7
- build-essential wget git cmake libcurl4-openssl-dev \
 
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Clone llama.cpp
11
- RUN git clone https://github.com/ggerganov/llama.cpp
 
12
 
13
- # Build llama.cpp with CURL enabled
14
- WORKDIR /app/llama.cpp
15
- RUN cmake -B build -DLLAMA_CURL=ON && cmake --build build --config Release
16
-
17
- # Back to /app
18
- WORKDIR /app
19
 
20
- # Copy Python app
21
  COPY app.py .
22
 
23
- # Download model file
24
- RUN wget -O /app/model.gguf \
25
- https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf
26
 
27
- # Expose the llama.cpp HTTP server port
28
- EXPOSE 7860
29
 
30
- # Run the HTTP server
31
- CMD ["/app/llama.cpp/build/bin/llama-server", "-m", "/app/model.gguf", "-c", "2048", "-t", "2", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ cmake \
9
+ wget \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy requirements and install Python dependencies
13
+ COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Download the model file
17
+ RUN wget -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
18
+ https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf
 
 
 
19
 
20
+ # Copy application code
21
  COPY app.py .
22
 
23
+ # Expose Streamlit port
24
+ EXPOSE 8501
 
25
 
26
+ # Health check
27
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
28
 
29
+ # Run the application
30
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]