Spaces:
Running
Running
update dockerfile
Browse files- Dockerfile +9 -10
Dockerfile
CHANGED
@@ -4,32 +4,31 @@ FROM ghcr.io/huggingface/spaces-cpu:latest
|
|
4 |
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
|
5 |
|
6 |
# 1. Copy and install OS-level dependencies
|
7 |
-
echo "### STEP 1: Installing APT packages"
|
8 |
COPY packages.txt ./
|
9 |
-
RUN
|
|
|
10 |
xargs -r -a packages.txt apt-get install -y --no-install-recommends && \
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# 2. Set CMake flags for OpenBLAS
|
14 |
-
echo "### STEP 2: Setting CMake flags for OpenBLAS"
|
15 |
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
16 |
|
17 |
# 3. Set working directory and copy application code
|
18 |
-
echo "### STEP 3: Copying application code"
|
19 |
WORKDIR /app
|
20 |
COPY requirements.txt ./
|
21 |
COPY app.py ./
|
22 |
-
# (Copy additional code or folders as needed)
|
23 |
|
24 |
# 4. Install Python dependencies (excluding llama-cpp-python)
|
25 |
-
echo "### STEP 4: Installing Python dependencies"
|
26 |
-
|
27 |
|
28 |
# 5. Build and install llama-cpp-python from source with OpenBLAS
|
29 |
-
echo "### STEP 5: Building llama-cpp-python from source"
|
30 |
-
|
31 |
|
32 |
# 6. Expose port and launch
|
33 |
-
echo "### STEP 6: Launching application"
|
34 |
EXPOSE 7860
|
35 |
CMD ["python", "app.py"]
|
|
|
4 |
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
|
5 |
|
6 |
# 1. Copy and install OS-level dependencies
|
|
|
7 |
COPY packages.txt ./
|
8 |
+
RUN echo "### STEP 1: Installing APT packages" && \
|
9 |
+
apt-get update && \
|
10 |
xargs -r -a packages.txt apt-get install -y --no-install-recommends && \
|
11 |
rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
# 2. Set CMake flags for OpenBLAS
|
14 |
+
RUN echo "### STEP 2: Setting CMake flags for OpenBLAS"
|
15 |
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
16 |
|
17 |
# 3. Set working directory and copy application code
|
18 |
+
RUN echo "### STEP 3: Copying application code"
|
19 |
WORKDIR /app
|
20 |
COPY requirements.txt ./
|
21 |
COPY app.py ./
|
|
|
22 |
|
23 |
# 4. Install Python dependencies (excluding llama-cpp-python)
|
24 |
+
RUN echo "### STEP 4: Installing Python dependencies" && \
|
25 |
+
pip install --no-cache-dir -r requirements.txt
|
26 |
|
27 |
# 5. Build and install llama-cpp-python from source with OpenBLAS
|
28 |
+
RUN echo "### STEP 5: Building llama-cpp-python from source" && \
|
29 |
+
pip install --no-cache-dir --force-reinstall --no-binary llama-cpp-python llama-cpp-python
|
30 |
|
31 |
# 6. Expose port and launch
|
32 |
+
RUN echo "### STEP 6: Launching application"
|
33 |
EXPOSE 7860
|
34 |
CMD ["python", "app.py"]
|