Glitche commited on
Update Dockerfile
Browse files- Dockerfile +18 -17
Dockerfile
CHANGED
|
@@ -8,6 +8,24 @@
|
|
| 8 |
|
| 9 |
FROM python:3.11-slim
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
RUN python - <<'PY'
|
| 12 |
from huggingface_hub import hf_hub_download
|
| 13 |
import os
|
|
@@ -30,23 +48,6 @@ hf_hub_download(
|
|
| 30 |
print("WavTokenizer files downloaded.")
|
| 31 |
PY
|
| 32 |
|
| 33 |
-
# Whisper needs ffmpeg to read audio files, this installs it at the
|
| 34 |
-
# system level since it can't come from pip.
|
| 35 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 36 |
-
build-essential \
|
| 37 |
-
ffmpeg \
|
| 38 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 39 |
-
|
| 40 |
-
# Run as a non-root user, standard practice and specifically expected by
|
| 41 |
-
# Hugging Face Spaces' Docker SDK.
|
| 42 |
-
RUN useradd -m -u 1000 user
|
| 43 |
-
USER user
|
| 44 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 45 |
-
|
| 46 |
-
WORKDIR /home/user/app
|
| 47 |
-
|
| 48 |
-
COPY --chown=user requirements.txt .
|
| 49 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 50 |
|
| 51 |
COPY --chown=user . .
|
| 52 |
|
|
|
|
| 8 |
|
| 9 |
FROM python:3.11-slim
|
| 10 |
|
| 11 |
+
# Whisper needs ffmpeg to read audio files, this installs it at the
|
| 12 |
+
# system level since it can't come from pip.
|
| 13 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
+
build-essential \
|
| 15 |
+
ffmpeg \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Run as a non-root user, standard practice and specifically expected by
|
| 19 |
+
# Hugging Face Spaces' Docker SDK.
|
| 20 |
+
RUN useradd -m -u 1000 user
|
| 21 |
+
USER user
|
| 22 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 23 |
+
|
| 24 |
+
WORKDIR /home/user/app
|
| 25 |
+
|
| 26 |
+
COPY --chown=user requirements.txt .
|
| 27 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 28 |
+
|
| 29 |
RUN python - <<'PY'
|
| 30 |
from huggingface_hub import hf_hub_download
|
| 31 |
import os
|
|
|
|
| 48 |
print("WavTokenizer files downloaded.")
|
| 49 |
PY
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
COPY --chown=user . .
|
| 53 |
|