Update Dockerfile
Browse files- 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
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
# Copy application
|
|
|
|
| 21 |
COPY app.py .
|
| 22 |
|
| 23 |
-
# Expose
|
| 24 |
-
EXPOSE
|
| 25 |
|
| 26 |
# Health check
|
| 27 |
-
HEALTHCHECK
|
|
|
|
| 28 |
|
| 29 |
-
# Run
|
| 30 |
-
CMD ["streamlit", "run", "app.py", "--server.port=
|
|
|
|
| 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"]
|