Update Dockerfile
Browse files- Dockerfile +10 -5
Dockerfile
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# Install minimal system tools needed for audio (ffmpeg)
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
ffmpeg \
|
|
@@ -13,17 +16,19 @@ ENV HF_HOME="/home/user/.cache/huggingface"
|
|
| 13 |
|
| 14 |
WORKDIR /home/user/app
|
| 15 |
|
| 16 |
-
# Install dependencies
|
| 17 |
-
# We keep the extra-index-url so it downloads the fast CPU wheel,
|
| 18 |
-
# but removed --only-binary so it correctly detects our Debian (glibc) environment.
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 20 |
pip install --no-cache-dir \
|
| 21 |
flask==3.1.1 \
|
| 22 |
edge-tts \
|
| 23 |
num2words==0.5.14 \
|
| 24 |
"huggingface_hub>=0.27.0" \
|
| 25 |
-
"numpy<2.0"
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 28 |
|
| 29 |
# Copy the rest of the application
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# CRITICAL: This forces Python to print logs immediately instead of hiding them
|
| 4 |
+
ENV PYTHONUNBUFFERED=1
|
| 5 |
+
|
| 6 |
# Install minimal system tools needed for audio (ffmpeg)
|
| 7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 8 |
ffmpeg \
|
|
|
|
| 16 |
|
| 17 |
WORKDIR /home/user/app
|
| 18 |
|
| 19 |
+
# 1. Install standard dependencies first
|
|
|
|
|
|
|
| 20 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 21 |
pip install --no-cache-dir \
|
| 22 |
flask==3.1.1 \
|
| 23 |
edge-tts \
|
| 24 |
num2words==0.5.14 \
|
| 25 |
"huggingface_hub>=0.27.0" \
|
| 26 |
+
"numpy<2.0"
|
| 27 |
+
|
| 28 |
+
# 2. Install llama-cpp-python safely.
|
| 29 |
+
# --only-binary llama-cpp-python ensures it NEVER tries to compile from source and hang forever.
|
| 30 |
+
RUN pip install --no-cache-dir llama-cpp-python \
|
| 31 |
+
--only-binary llama-cpp-python \
|
| 32 |
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
|
| 33 |
|
| 34 |
# Copy the rest of the application
|