Spaces:
Configuration error
Configuration error
Fedir Zadniprovskyi
commited on
Commit
·
30e776b
1
Parent(s):
9484083
fix: docker image not running in offline mode (#127)
Browse files- Dockerfile +6 -1
Dockerfile
CHANGED
@@ -8,10 +8,14 @@ RUN apt-get update && \
|
|
8 |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ffmpeg python3.12 && \
|
9 |
apt-get clean && \
|
10 |
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
11 |
USER ubuntu
|
12 |
ENV HOME=/home/ubuntu \
|
13 |
PATH=/home/ubuntu/.local/bin:$PATH
|
14 |
WORKDIR $HOME/faster-whisper-server
|
|
|
15 |
COPY --chown=ubuntu --from=ghcr.io/astral-sh/uv:0.5.14 /uv /bin/uv
|
16 |
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
17 |
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
|
@@ -25,5 +29,6 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|
25 |
ENV WHISPER__MODEL=Systran/faster-whisper-large-v3
|
26 |
ENV UVICORN_HOST=0.0.0.0
|
27 |
ENV UVICORN_PORT=8000
|
|
|
28 |
EXPOSE 8000
|
29 |
-
CMD ["
|
|
|
8 |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ffmpeg python3.12 && \
|
9 |
apt-get clean && \
|
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
|
14 |
USER ubuntu
|
15 |
ENV HOME=/home/ubuntu \
|
16 |
PATH=/home/ubuntu/.local/bin:$PATH
|
17 |
WORKDIR $HOME/faster-whisper-server
|
18 |
+
# https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
|
19 |
COPY --chown=ubuntu --from=ghcr.io/astral-sh/uv:0.5.14 /uv /bin/uv
|
20 |
# https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
|
21 |
# https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
|
|
|
29 |
ENV WHISPER__MODEL=Systran/faster-whisper-large-v3
|
30 |
ENV UVICORN_HOST=0.0.0.0
|
31 |
ENV UVICORN_PORT=8000
|
32 |
+
ENV PATH="$HOME/faster-whisper-server/.venv/bin:$PATH"
|
33 |
EXPOSE 8000
|
34 |
+
CMD ["uvicorn", "--factory", "faster_whisper_server.main:create_app"]
|