Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -16
Dockerfile
CHANGED
|
@@ -1,30 +1,20 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# 1.
|
| 4 |
-
RUN apt-get update && apt-get install -y \
|
| 5 |
-
git \
|
| 6 |
-
build-essential \
|
| 7 |
-
cmake \
|
| 8 |
-
wget \
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
# 2. Setup User 1000 (Required for HF Spaces)
|
| 12 |
RUN useradd -m -u 1000 user
|
| 13 |
USER user
|
| 14 |
ENV HOME=/home/user \
|
| 15 |
PATH=/home/user/.local/bin:$PATH
|
|
|
|
| 16 |
WORKDIR $HOME/app
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
# We install llama-cpp-python first to utilize caching
|
| 20 |
RUN pip install --no-cache-dir \
|
| 21 |
-
llama-cpp-python
|
| 22 |
huggingface_hub \
|
| 23 |
-
gradio
|
| 24 |
-
python-dotenv
|
| 25 |
|
| 26 |
-
#
|
| 27 |
COPY --chown=user . .
|
| 28 |
|
| 29 |
-
# 5. Start the app
|
| 30 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# 1. Setup User 1000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
USER user
|
| 6 |
ENV HOME=/home/user \
|
| 7 |
PATH=/home/user/.local/bin:$PATH
|
| 8 |
+
|
| 9 |
WORKDIR $HOME/app
|
| 10 |
|
| 11 |
+
# 2. Install dependencies (This will use pre-built WHEELS - no compiling)
|
|
|
|
| 12 |
RUN pip install --no-cache-dir \
|
| 13 |
+
llama-cpp-python \
|
| 14 |
huggingface_hub \
|
| 15 |
+
gradio
|
|
|
|
| 16 |
|
| 17 |
+
# 3. Copy app
|
| 18 |
COPY --chown=user . .
|
| 19 |
|
|
|
|
| 20 |
CMD ["python", "app.py"]
|