Fedir Zadniprovskyi commited on
Commit
c9f760a
·
1 Parent(s): 4b9d55e

fix: permission error due to volume being mounted as root

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -0
Dockerfile CHANGED
@@ -26,6 +26,10 @@ RUN --mount=type=cache,target=/root/.cache/uv \
26
  COPY --chown=ubuntu ./src ./pyproject.toml ./uv.lock ./
27
  RUN --mount=type=cache,target=/root/.cache/uv \
28
  uv sync --frozen --compile-bytecode --extra ui
 
 
 
 
29
  ENV WHISPER__MODEL=Systran/faster-whisper-large-v3
30
  ENV UVICORN_HOST=0.0.0.0
31
  ENV UVICORN_PORT=8000
 
26
  COPY --chown=ubuntu ./src ./pyproject.toml ./uv.lock ./
27
  RUN --mount=type=cache,target=/root/.cache/uv \
28
  uv sync --frozen --compile-bytecode --extra ui
29
+ # Creating a directory for the cache to avoid the following error:
30
+ # PermissionError: [Errno 13] Permission denied: '/home/ubuntu/.cache/huggingface/hub'
31
+ # This error occurs because the volume is mounted as root and the `ubuntu` user doesn't have permission to write to it. Pre-creating the directory solves this issue.
32
+ RUN mkdir -p $HOME/.cache/huggingface
33
  ENV WHISPER__MODEL=Systran/faster-whisper-large-v3
34
  ENV UVICORN_HOST=0.0.0.0
35
  ENV UVICORN_PORT=8000