Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -17
Dockerfile
CHANGED
|
@@ -1,22 +1,17 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
-
git ffmpeg libsm6 libxext6 libgl1
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
-
# Install uv + uvx globally
|
| 8 |
-
RUN curl -Ls https://astral.sh/uv/install.sh | sh \
|
| 9 |
-
&& cp /root/.local/bin/uv /usr/local/bin/uv \
|
| 10 |
-
&& cp /root/.local/bin/uvx /usr/local/bin/uvx \
|
| 11 |
-
&& chmod 755 /usr/local/bin/uv /usr/local/bin/uvx
|
| 12 |
-
|
| 13 |
WORKDIR /app
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
-
# Step 1: Install tribev2
|
| 17 |
RUN pip install --no-cache-dir git+https://github.com/facebookresearch/tribev2.git
|
| 18 |
|
| 19 |
-
# Step 2: Install whisperx
|
|
|
|
| 20 |
RUN pip install --no-cache-dir \
|
| 21 |
faster-whisper \
|
| 22 |
ctranslate2 \
|
|
@@ -28,15 +23,10 @@ RUN pip install --no-cache-dir \
|
|
| 28 |
git+https://github.com/m-bain/whisperX.git \
|
| 29 |
--no-deps
|
| 30 |
|
| 31 |
-
# Step 3: Install remaining deps
|
| 32 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
RUN printf '#!/usr/bin/env python\nimport sys\nfrom whisperx.cli import main\nsys.exit(main())\n' \
|
| 36 |
-
> /usr/local/bin/whisperx \
|
| 37 |
-
&& chmod 755 /usr/local/bin/whisperx
|
| 38 |
-
|
| 39 |
-
# Non-root user
|
| 40 |
RUN useradd -m -u 1000 user
|
| 41 |
USER user
|
| 42 |
ENV HOME=/home/user PATH=/usr/local/bin:/home/user/.local/bin:$PATH
|
|
@@ -44,4 +34,4 @@ WORKDIR /home/user/app
|
|
| 44 |
COPY --chown=user app.py .
|
| 45 |
|
| 46 |
EXPOSE 7860
|
| 47 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
+
git ffmpeg libsm6 libxext6 libgl1 \
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# Step 1: Install tribev2 (pins torch to 2.5.x-2.6.x)
|
| 11 |
RUN pip install --no-cache-dir git+https://github.com/facebookresearch/tribev2.git
|
| 12 |
|
| 13 |
+
# Step 2: Install whisperx deps that are compatible with tribev2's torch,
|
| 14 |
+
# then whisperx itself without pulling its own torch version.
|
| 15 |
RUN pip install --no-cache-dir \
|
| 16 |
faster-whisper \
|
| 17 |
ctranslate2 \
|
|
|
|
| 23 |
git+https://github.com/m-bain/whisperX.git \
|
| 24 |
--no-deps
|
| 25 |
|
| 26 |
+
# Step 3: Install remaining app deps
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
+
# Non-root user (HuggingFace Spaces requirement)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
RUN useradd -m -u 1000 user
|
| 31 |
USER user
|
| 32 |
ENV HOME=/home/user PATH=/usr/local/bin:/home/user/.local/bin:$PATH
|
|
|
|
| 34 |
COPY --chown=user app.py .
|
| 35 |
|
| 36 |
EXPOSE 7860
|
| 37 |
+
CMD ["python", "app.py"]
|