MalikSahib1 commited on
Commit
ced8ba6
·
verified ·
1 Parent(s): e1761d3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -4,12 +4,15 @@ FROM python:3.9-slim
4
  # Set the working directory in the container to /code
5
  WORKDIR /code
6
 
7
- # --- THIS IS THE FIX ---
8
  # Set the environment variable for the Hugging Face cache.
9
- # This tells the library to download models into /code/cache, which is a writable directory.
10
  ENV HF_HOME /code/cache
11
  ENV HUGGINGFACE_HUB_CACHE /code/cache
12
 
 
 
 
 
 
13
  # Copy the requirements file into the container at /code
14
  COPY ./requirements.txt /code/requirements.txt
15
 
 
4
  # Set the working directory in the container to /code
5
  WORKDIR /code
6
 
 
7
  # Set the environment variable for the Hugging Face cache.
 
8
  ENV HF_HOME /code/cache
9
  ENV HUGGINGFACE_HUB_CACHE /code/cache
10
 
11
+ # --- THIS IS THE FINAL FIX ---
12
+ # Create the cache directory during the build and give it open permissions.
13
+ # The non-root user running the app needs permission to write to this folder.
14
+ RUN mkdir -p /code/cache && chmod 777 /code/cache
15
+
16
  # Copy the requirements file into the container at /code
17
  COPY ./requirements.txt /code/requirements.txt
18