Update Dockerfile
Browse files- Dockerfile +5 -11
Dockerfile
CHANGED
|
@@ -1,14 +1,7 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
#
|
| 5 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
-
ffmpeg \
|
| 7 |
-
git \
|
| 8 |
-
build-essential \
|
| 9 |
-
cmake \
|
| 10 |
-
python3-dev \
|
| 11 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# HF Spaces requires uid 1000
|
| 14 |
RUN useradd -m -u 1000 user
|
|
@@ -18,10 +11,11 @@ ENV HF_HOME="/home/user/.cache/huggingface"
|
|
| 18 |
|
| 19 |
WORKDIR /home/user/app
|
| 20 |
|
| 21 |
-
#
|
| 22 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 23 |
pip install --no-cache-dir \
|
| 24 |
llama-cpp-python \
|
|
|
|
| 25 |
edge-tts \
|
| 26 |
flask==3.1.1 \
|
| 27 |
"numpy<2.0" \
|
|
@@ -33,4 +27,4 @@ COPY --chown=user:user . .
|
|
| 33 |
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
CMD["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# We removed ALL system installations (cmake, build-essential, git, ffmpeg, etc.)
|
| 4 |
+
# to make the build nearly instant and avoid installing useless stuff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# HF Spaces requires uid 1000
|
| 7 |
RUN useradd -m -u 1000 user
|
|
|
|
| 11 |
|
| 12 |
WORKDIR /home/user/app
|
| 13 |
|
| 14 |
+
# We use a PRE-BUILT wheel for llama-cpp-python so it installs in seconds (no C++ compiling!)
|
| 15 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 16 |
pip install --no-cache-dir \
|
| 17 |
llama-cpp-python \
|
| 18 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 19 |
edge-tts \
|
| 20 |
flask==3.1.1 \
|
| 21 |
"numpy<2.0" \
|
|
|
|
| 27 |
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
CMD ["python", "app.py"]
|