DataChem commited on
Commit
44a3db2
·
verified ·
1 Parent(s): 4f089ce

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -0
Dockerfile CHANGED
@@ -7,12 +7,14 @@ ENV PATH="/home/user/.local/bin:$PATH"
7
 
8
  # Set a writable cache directory for Hugging Face Transformers
9
  ENV TRANSFORMERS_CACHE="/app/.cache"
 
10
 
11
  # Set the working directory inside the container
12
  WORKDIR /app
13
 
14
  # Copy the dependencies and install them as root
15
  COPY requirements.txt .
 
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Switch to the non-root user after installing dependencies
 
7
 
8
  # Set a writable cache directory for Hugging Face Transformers
9
  ENV TRANSFORMERS_CACHE="/app/.cache"
10
+ ENV HF_HOME="/app/.cache" # For compatibility with future Transformers versions
11
 
12
  # Set the working directory inside the container
13
  WORKDIR /app
14
 
15
  # Copy the dependencies and install them as root
16
  COPY requirements.txt .
17
+ RUN mkdir -p /app/.cache && chown -R user:user /app/.cache # Fix permissions for cache
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
  # Switch to the non-root user after installing dependencies