Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +10 -3
Dockerfile
CHANGED
|
@@ -1,7 +1,11 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
# Install system dependencies
|
| 4 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
|
@@ -9,17 +13,20 @@ WORKDIR /app
|
|
| 9 |
RUN pip install --no-cache-dir --upgrade pip
|
| 10 |
|
| 11 |
# Install llama-cpp-python using the official pre-built wheel index
|
| 12 |
-
# This is much more reliable than a direct GitHub link
|
| 13 |
RUN pip install --no-cache-dir llama-cpp-python \
|
| 14 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 15 |
|
| 16 |
-
# Install web
|
| 17 |
RUN pip install --no-cache-dir flask requests huggingface-hub
|
| 18 |
|
|
|
|
| 19 |
COPY . .
|
| 20 |
|
|
|
|
| 21 |
EXPOSE 7860
|
| 22 |
|
|
|
|
| 23 |
ENV PYTHONUNBUFFERED=1
|
| 24 |
|
|
|
|
| 25 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
# Install system dependencies
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
build-essential \
|
| 6 |
+
cmake \
|
| 7 |
+
libgomp1 \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
|
|
|
| 13 |
RUN pip install --no-cache-dir --upgrade pip
|
| 14 |
|
| 15 |
# Install llama-cpp-python using the official pre-built wheel index
|
|
|
|
| 16 |
RUN pip install --no-cache-dir llama-cpp-python \
|
| 17 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 18 |
|
| 19 |
+
# Install web + Hugging Face tools
|
| 20 |
RUN pip install --no-cache-dir flask requests huggingface-hub
|
| 21 |
|
| 22 |
+
# Copy your app code
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
+
# Expose the port
|
| 26 |
EXPOSE 7860
|
| 27 |
|
| 28 |
+
# Ensure output is unbuffered
|
| 29 |
ENV PYTHONUNBUFFERED=1
|
| 30 |
|
| 31 |
+
# Run your app
|
| 32 |
CMD ["python", "app.py"]
|