Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -2,23 +2,24 @@ 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 |
curl \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Copy requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
RUN
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 22 |
|
| 23 |
# Copy application files
|
| 24 |
COPY api.py .
|
|
@@ -31,5 +32,5 @@ EXPOSE 7860
|
|
| 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
|
| 35 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies (minimal for pre-compiled wheels)
|
| 6 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
| 7 |
wget \
|
| 8 |
curl \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# Copy requirements first for better caching
|
| 12 |
COPY requirements.txt .
|
|
|
|
| 13 |
|
| 14 |
+
# Install Python dependencies with pre-compiled llama-cpp-python
|
| 15 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 16 |
+
pip install --no-cache-dir -r requirements.txt
|
| 17 |
+
|
| 18 |
+
# Download model file (this is the time-consuming part, but should work)
|
| 19 |
+
RUN echo "📥 Downloading CapybaraHermes model..." && \
|
| 20 |
+
wget --progress=bar:force:noscroll -O capybarahermes-2.5-mistral-7b.Q5_K_M.gguf \
|
| 21 |
https://huggingface.co/TheBloke/CapybaraHermes-2.5-Mistral-7B-GGUF/resolve/main/capybarahermes-2.5-mistral-7b.Q5_K_M.gguf && \
|
| 22 |
+
echo "✅ Model downloaded: $(du -h capybarahermes-2.5-mistral-7b.Q5_K_M.gguf | cut -f1)"
|
| 23 |
|
| 24 |
# Copy application files
|
| 25 |
COPY api.py .
|
|
|
|
| 32 |
HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
|
| 33 |
CMD curl --fail http://localhost:7860/_stcore/health || exit 1
|
| 34 |
|
| 35 |
+
# Run Streamlit on port 7860
|
| 36 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|