

fix: docker image not running in offline mode (#127)
@769a1d7120f62d7fa68ed53a733f31bc35f17788
--- Dockerfile
+++ Dockerfile
... | ... | @@ -8,10 +8,14 @@ |
8 | 8 |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ffmpeg python3.12 && \ |
9 | 9 |
apt-get clean && \ |
10 | 10 |
rm -rf /var/lib/apt/lists/* |
11 |
+# "ubuntu" is the default user on ubuntu images with UID=1000. This user is used for two reasons: |
|
12 |
+# 1. It's generally a good practice to run containers as non-root users. See https://www.docker.com/blog/understanding-the-docker-user-instruction/ |
|
13 |
+# 2. Docker Spaces on HuggingFace don't support running containers as root. See https://huggingface.co/docs/hub/en/spaces-sdks-docker#permissions |
|
11 | 14 |
USER ubuntu |
12 | 15 |
ENV HOME=/home/ubuntu \ |
13 | 16 |
PATH=/home/ubuntu/.local/bin:$PATH |
14 | 17 |
WORKDIR $HOME/faster-whisper-server |
18 |
+# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv |
|
15 | 19 |
COPY --chown=ubuntu --from=ghcr.io/astral-sh/uv:0.5.14 /uv /bin/uv |
16 | 20 |
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers |
17 | 21 |
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode |
... | ... | @@ -25,5 +29,6 @@ |
25 | 29 |
ENV WHISPER__MODEL=Systran/faster-whisper-large-v3 |
26 | 30 |
ENV UVICORN_HOST=0.0.0.0 |
27 | 31 |
ENV UVICORN_PORT=8000 |
32 |
+ENV PATH="$HOME/faster-whisper-server/.venv/bin:$PATH" |
|
28 | 33 |
EXPOSE 8000 |
29 |
-CMD ["uv", "run", "uvicorn", "--factory", "faster_whisper_server.main:create_app"] |
|
34 |
+CMD ["uvicorn", "--factory", "faster_whisper_server.main:create_app"] |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?