Create Dockerfile
Browse files- Dockerfile +34 -0
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
wget \
|
| 8 |
+
curl \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Install llama-cpp-python with prebuilt CPU wheel
|
| 12 |
+
RUN pip install --no-cache-dir \
|
| 13 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 14 |
+
llama-cpp-python==0.2.24
|
| 15 |
+
|
| 16 |
+
# Copy and install remaining Python dependencies
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 19 |
+
pip install --no-cache-dir -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# Download the Zephyr Quiklang model (Q4_K_M)
|
| 22 |
+
RUN wget --progress=bar:force:noscroll -O zephyr-quiklang-3b-4k.Q4_K_M.gguf \
|
| 23 |
+
https://huggingface.co/TheBloke/zephyr-quiklang-3b-4K-GGUF/resolve/main/zephyr-quiklang-3b-4k.Q4_K_M.gguf
|
| 24 |
+
|
| 25 |
+
# Copy app files
|
| 26 |
+
COPY api.py .
|
| 27 |
+
COPY app.py .
|
| 28 |
+
|
| 29 |
+
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=300s --retries=3 \
|
| 32 |
+
CMD curl --fail http://localhost:7860/_stcore/health || exit 1
|
| 33 |
+
|
| 34 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|