Update Dockerfile
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
|
@@ -5,7 +5,7 @@ FROM python:3.10-slim
|
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
|
| 7 |
# Install system dependencies needed to *build* llama-cpp-python
|
| 8 |
-
# This
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
build-essential \
|
| 11 |
cmake \
|
|
@@ -19,7 +19,13 @@ COPY ./requirements.txt /app/requirements.txt
|
|
| 19 |
|
| 20 |
# Install Python packages
|
| 21 |
RUN pip install --no-cache-dir --upgrade pip
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Copy the main application file
|
| 25 |
COPY ./app.py /app/app.py
|
|
@@ -29,4 +35,4 @@ EXPOSE 7860
|
|
| 29 |
|
| 30 |
# Command to run the application
|
| 31 |
# This starts app.py, which will THEN download the model.
|
| 32 |
-
CMD ["python", "app.py"]
|
|
|
|
| 5 |
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
|
| 7 |
# Install system dependencies needed to *build* llama-cpp-python
|
| 8 |
+
# This is still needed for the pre-built wheel to work
|
| 9 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
build-essential \
|
| 11 |
cmake \
|
|
|
|
| 19 |
|
| 20 |
# Install Python packages
|
| 21 |
RUN pip install --no-cache-dir --upgrade pip
|
| 22 |
+
|
| 23 |
+
# --- THIS IS THE FIX ---
|
| 24 |
+
# We tell pip to look at a special URL to find pre-compiled
|
| 25 |
+
# CPU-only versions of llama-cpp-python.
|
| 26 |
+
# This avoids compiling from source, fixing the timeout.
|
| 27 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt \
|
| 28 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 29 |
|
| 30 |
# Copy the main application file
|
| 31 |
COPY ./app.py /app/app.py
|
|
|
|
| 35 |
|
| 36 |
# Command to run the application
|
| 37 |
# This starts app.py, which will THEN download the model.
|
| 38 |
+
CMD ["python", "app.py"]
|