Spaces:
Build error
Build error
helloguddn (PC helloguddn) commited on
Commit ·
32dfa8a
1
Parent(s): 7cb509d
use slim
Browse files- Dockerfile +14 -11
Dockerfile
CHANGED
|
@@ -1,14 +1,17 @@
|
|
| 1 |
-
FROM python:3.10-
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
# Alpine은 musl libc를 사용하므로, musl 환경용 llama-cpp-python 바이너리가 올바르게 로드됩니다.
|
| 5 |
USER root
|
| 6 |
-
RUN
|
| 7 |
-
build-
|
| 8 |
cmake \
|
| 9 |
git \
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
## 2. 사용자 설정 (user는 만들되, 설치는 root로 수행합니다)
|
| 14 |
RUN useradd -m -u 1000 user
|
|
@@ -26,9 +29,8 @@ RUN pip install --no-cache-dir --upgrade pip
|
|
| 26 |
COPY requirements.txt .
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
-
# 4. llama-cpp-python:
|
| 30 |
-
#
|
| 31 |
-
# --prefer-binary로 가능하면 사전 빌드 휠을 사용합니다.
|
| 32 |
RUN CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUBLAS=OFF" \
|
| 33 |
pip install --no-cache-dir --prefer-binary \
|
| 34 |
llama-cpp-python
|
|
@@ -37,4 +39,5 @@ RUN CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUBLAS=OFF" \
|
|
| 37 |
COPY --chown=user:user . .
|
| 38 |
USER user
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Use Debian-slim (glibc) for compatibility with manylinux wheels on Hugging Face
|
|
|
|
| 4 |
USER root
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
build-essential \
|
| 7 |
cmake \
|
| 8 |
git \
|
| 9 |
+
gcc \
|
| 10 |
+
g++ \
|
| 11 |
+
libgomp1 \
|
| 12 |
+
libopenblas-dev \
|
| 13 |
+
libstdc++6 \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
## 2. 사용자 설정 (user는 만들되, 설치는 root로 수행합니다)
|
| 17 |
RUN useradd -m -u 1000 user
|
|
|
|
| 29 |
COPY requirements.txt .
|
| 30 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 31 |
|
| 32 |
+
# 4. llama-cpp-python: 가능한 경우 manylinux wheel을 사용하도록 --prefer-binary
|
| 33 |
+
# If no wheel matches, this will build from source (cmake/python-dev provided above).
|
|
|
|
| 34 |
RUN CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUBLAS=OFF" \
|
| 35 |
pip install --no-cache-dir --prefer-binary \
|
| 36 |
llama-cpp-python
|
|
|
|
| 39 |
COPY --chown=user:user . .
|
| 40 |
USER user
|
| 41 |
|
| 42 |
+
# Use PORT env if provided by hosting (Hugging Face), fallback to 7860
|
| 43 |
+
CMD ["sh", "-c", "uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860}"]
|