Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -7
Dockerfile
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
cmake \
|
| 9 |
-
git \
|
| 10 |
python3-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
@@ -14,14 +13,11 @@ RUN apt-get update && apt-get install -y \
|
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
# Build llama-cpp-python from source (CPU-only)
|
| 18 |
RUN pip install --no-cache-dir llama-cpp-python
|
| 19 |
|
| 20 |
# Copy application file
|
| 21 |
COPY app.py .
|
| 22 |
|
| 23 |
-
# Expose ports
|
| 24 |
EXPOSE 7860 7861
|
| 25 |
-
|
| 26 |
-
# Run the application
|
| 27 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.11
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install only the essentials for building llama-cpp-python
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
cmake \
|
|
|
|
| 9 |
python3-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
|
|
|
| 13 |
COPY requirements.txt .
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Build llama-cpp-python from source (CPU-only, no BLAS/OpenMP)
|
| 17 |
RUN pip install --no-cache-dir llama-cpp-python
|
| 18 |
|
| 19 |
# Copy application file
|
| 20 |
COPY app.py .
|
| 21 |
|
|
|
|
| 22 |
EXPOSE 7860 7861
|
|
|
|
|
|
|
| 23 |
CMD ["python", "app.py"]
|