Testshded commited on
Commit
b19aa89
·
verified ·
1 Parent(s): 5f3a5b8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -4,11 +4,15 @@ FROM python:3.11-slim
4
  # Set the working directory inside the container
5
  WORKDIR /code
6
 
7
- # --- THE FIX ---
8
  # Set an environment variable to tell Hugging Face libraries where to cache models.
9
- # This ensures it writes to a folder we have permission for.
10
  ENV HF_HOME /code/cache
11
- # ---------------
 
 
 
 
 
 
12
 
13
  # Copy the requirements file into the container
14
  COPY ./requirements.txt /code/requirements.txt
 
4
  # Set the working directory inside the container
5
  WORKDIR /code
6
 
 
7
  # Set an environment variable to tell Hugging Face libraries where to cache models.
 
8
  ENV HF_HOME /code/cache
9
+
10
+ # --- THE FINAL FIX ---
11
+ # Create the cache directory and make it writable by any user.
12
+ # This solves the PermissionError in restrictive environments.
13
+ RUN mkdir -p /code/cache && \
14
+ chmod -R 777 /code/cache
15
+ # ---------------------
16
 
17
  # Copy the requirements file into the container
18
  COPY ./requirements.txt /code/requirements.txt