owlninjam commited on
Commit
0ec3aae
·
verified ·
1 Parent(s): 5c2a58a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -13
Dockerfile CHANGED
@@ -2,38 +2,37 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install minimal system dependencies + build tools
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
  curl \
9
- build-essential \
10
- cmake \
11
- python3-dev \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy requirements
15
- COPY requirements.txt .
 
16
 
17
- # Install Python packages
 
18
  RUN pip install --no-cache-dir --upgrade pip && \
19
- pip install --no-cache-dir --prefer-binary -r requirements.txt
20
 
21
- # Download GGUF model
22
  RUN echo "📥 Downloading CapybaraHermes model..." && \
23
  wget --progress=bar:force:noscroll -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
24
  https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf && \
25
  echo "✅ Model downloaded: $(du -h capybarahermes-2.5-mistral-7b.Q5_K_M.gguf | cut -f1)"
26
 
27
- # Copy app code
28
  COPY api.py .
29
  COPY app.py .
30
 
31
- # Expose Hugging Face port
32
  EXPOSE 7860
33
 
34
- # Health check
35
  HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
36
  CMD curl --fail http://localhost:7860/_stcore/health || exit 1
37
 
38
- # Start Streamlit
39
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install minimal system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  wget \
8
  curl \
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Install precompiled llama-cpp-python wheel (v0.2.24 for Python 3.10)
12
+ RUN pip install --no-cache-dir \
13
+ https://github.com/abetlen/llama-cpp-python/releases/download/v0.2.24/llama_cpp_python-0.2.24-cp310-cp310-manylinux2014_x86_64.whl
14
 
15
+ # Copy and install the rest of the Python dependencies
16
+ COPY requirements.txt .
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
+ pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Download the quantized model file (Q5_K_M)
21
  RUN echo "📥 Downloading CapybaraHermes model..." && \
22
  wget --progress=bar:force:noscroll -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
23
  https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf && \
24
  echo "✅ Model downloaded: $(du -h capybarahermes-2.5-mistral-7b.Q5_K_M.gguf | cut -f1)"
25
 
26
+ # Copy application files
27
  COPY api.py .
28
  COPY app.py .
29
 
30
+ # Expose Streamlit port
31
  EXPOSE 7860
32
 
33
+ # Health check for Hugging Face Spaces
34
  HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
35
  CMD curl --fail http://localhost:7860/_stcore/health || exit 1
36
 
37
+ # Start Streamlit app
38
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]