Jofthomas HF Staff commited on
Commit
b344704
·
verified ·
1 Parent(s): 511ad2d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -8
Dockerfile CHANGED
@@ -19,20 +19,15 @@ RUN pip install --no-cache-dir --upgrade pip && \
19
  # Copy the rest of the application code into the container
20
  COPY . .
21
 
22
- # ---- ADD THIS LINE ----
 
 
23
  # Set environment variables for Hugging Face cache directories
24
- # Use directories within /app where the user has write permissions.
25
  ENV HF_HOME=/app/.cache/huggingface
26
  ENV HF_DATASETS_CACHE=/app/.cache/datasets
27
- # Alternatively, just HF_DATASETS_CACHE might be enough if only datasets are used.
28
- # Using HF_HOME covers models, datasets, etc.
29
- # ---- END OF ADDED LINE ----
30
 
31
  # Expose the port the app runs on
32
- # This informs Docker that the container listens on this port
33
  EXPOSE 7860
34
 
35
  # Define the command to run the application
36
- # Use 0.0.0.0 to listen on all network interfaces inside the container
37
- # Uvicorn will listen on the port defined by the $PORT env var (7860)
38
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
19
  # Copy the rest of the application code into the container
20
  COPY . .
21
 
22
+ # Explicitly create cache dir and set open permissions during build
23
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
24
+
25
  # Set environment variables for Hugging Face cache directories
 
26
  ENV HF_HOME=/app/.cache/huggingface
27
  ENV HF_DATASETS_CACHE=/app/.cache/datasets
 
 
 
28
 
29
  # Expose the port the app runs on
 
30
  EXPOSE 7860
31
 
32
  # Define the command to run the application
 
 
33
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]