Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +8 -3
Dockerfile
CHANGED
|
@@ -1,26 +1,31 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
libgomp1 \
|
| 8 |
python3-dev \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
| 11 |
RUN useradd -m -u 1000 user
|
| 12 |
USER user
|
| 13 |
ENV HOME=/home/user \
|
| 14 |
PATH=/home/user/.local/bin:$PATH
|
| 15 |
WORKDIR $HOME/app
|
| 16 |
|
| 17 |
-
#
|
|
|
|
| 18 |
RUN pip install --no-cache-dir \
|
| 19 |
huggingface-hub \
|
| 20 |
flask \
|
| 21 |
--prefer-binary \
|
| 22 |
llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 23 |
|
|
|
|
| 24 |
COPY --chown=user . $HOME/app
|
| 25 |
|
|
|
|
| 26 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# 1. Use a standard Debian-based Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# 2. Install ONLY the essential glibc-compatible tools
|
| 5 |
+
# libgomp1 is the 'Missing Link' for the llama-cpp-python library
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
libgomp1 \
|
| 9 |
python3-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# 3. Setup User environment
|
| 13 |
RUN useradd -m -u 1000 user
|
| 14 |
USER user
|
| 15 |
ENV HOME=/home/user \
|
| 16 |
PATH=/home/user/.local/bin:$PATH
|
| 17 |
WORKDIR $HOME/app
|
| 18 |
|
| 19 |
+
# 4. THE MAGIC: This command tells pip to look for 'manylinux' wheels
|
| 20 |
+
# These are universal wheels that work on Debian/Ubuntu (Hugging Face's native language)
|
| 21 |
RUN pip install --no-cache-dir \
|
| 22 |
huggingface-hub \
|
| 23 |
flask \
|
| 24 |
--prefer-binary \
|
| 25 |
llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 26 |
|
| 27 |
+
# 5. Copy your Maira files
|
| 28 |
COPY --chown=user . $HOME/app
|
| 29 |
|
| 30 |
+
# 6. Fire up the engine
|
| 31 |
CMD ["python", "app.py"]
|