rohannsinghal commited on
Commit
358e82f
·
1 Parent(s): 60e69f7

fix: Correct cache directory permissions for deployment

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -10,12 +10,14 @@ COPY ./requirements.txt /code/requirements.txt
10
  # Install any needed packages specified in requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
- # --- ADD THESE TWO LINES ---
14
- # Create a writable directory for model caches
15
- RUN mkdir /code/cache
16
- # Tell the library to use this new directory
17
- ENV TRANSFORMERS_CACHE=/code/cache
18
- # --- END OF ADDITION ---
 
 
19
 
20
  # Copy your application code into the container
21
  COPY ./app /code/app
 
10
  # Install any needed packages specified in requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
 
13
+ # --- START: FINAL PERMISSION FIX ---
14
+ # Create a writable cache directory AND set the correct owner for the app user
15
+ RUN mkdir /code/cache && chown -R user:user /code/cache
16
+ # Tell all Hugging Face libraries to use this new directory (the modern way)
17
+ ENV HF_HOME=/code/cache
18
+ # Also set the specific variable for sentence-transformers for good measure
19
+ ENV SENTENCE_TRANSFORMERS_HOME=/code/cache
20
+ # --- END: FINAL PERMISSION FIX ---
21
 
22
  # Copy your application code into the container
23
  COPY ./app /code/app