owlninjam commited on
Commit
c449c0f
·
verified ·
1 Parent(s): 8a359f4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -7,6 +7,7 @@ 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
@@ -14,17 +15,21 @@ 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"]
 
7
  build-essential \
8
  cmake \
9
  wget \
10
+ curl \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  # Copy requirements and install Python dependencies
 
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
  # Download the model file
18
+ RUN echo "📥 Downloading CapybaraHermes model (5GB)..." && \
19
+ wget -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
20
+ https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf && \
21
+ echo "✅ Model downloaded successfully ($(du -h capybarahermes-2.5-mistral-7b.Q5_K_M.gguf | cut -f1))"
22
 
23
+ # Copy application files
24
+ COPY api.py .
25
  COPY app.py .
26
 
27
+ # Expose Hugging Face Spaces port
28
+ EXPOSE 7860
29
 
30
  # Health check
31
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
32
+ CMD curl --fail http://localhost:7860/_stcore/health || exit 1
33
 
34
+ # Run Streamlit on port 7860 (HF Spaces requirement)
35
+ CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]