Update Dockerfile
Browse files- Dockerfile +14 -12
Dockerfile
CHANGED
|
@@ -1,28 +1,30 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
USER user
|
| 9 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 10 |
-
ENV HF_HOME="/home/user/.cache/huggingface"
|
| 11 |
|
| 12 |
WORKDIR /home/user/app
|
| 13 |
|
| 14 |
-
#
|
|
|
|
| 15 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 16 |
pip install --no-cache-dir \
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
"numpy<2.0" \
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
|
| 25 |
-
# Copy the rest of the application
|
| 26 |
COPY --chown=user:user . .
|
| 27 |
|
| 28 |
EXPOSE 7860
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Install minimal system tools
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
ffmpeg \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
+
# Set up user
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
| 11 |
ENV PATH="/home/user/.local/bin:$PATH"
|
|
|
|
| 12 |
|
| 13 |
WORKDIR /home/user/app
|
| 14 |
|
| 15 |
+
# IMPORTANT: --only-binary :all: tells pip to NEVER compile C++ code
|
| 16 |
+
# It forces it to use pre-built wheels, which takes seconds.
|
| 17 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 18 |
pip install --no-cache-dir \
|
| 19 |
+
"flask" \
|
| 20 |
+
"edge-tts" \
|
| 21 |
+
"num2words" \
|
| 22 |
+
"huggingface_hub" \
|
| 23 |
"numpy<2.0" \
|
| 24 |
+
"llama-cpp-python" \
|
| 25 |
+
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu \
|
| 26 |
+
--only-binary :all:
|
| 27 |
|
|
|
|
| 28 |
COPY --chown=user:user . .
|
| 29 |
|
| 30 |
EXPOSE 7860
|