omgy commited on
Commit
6cff2b5
·
verified ·
1 Parent(s): f2406a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -1
Dockerfile CHANGED
@@ -2,6 +2,11 @@ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
 
 
 
 
 
5
  # Install dependencies
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
@@ -12,4 +17,7 @@ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
12
  # Copy source code
13
  COPY . .
14
 
15
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Set environment variables for Hugging Face cache
6
+ ENV HF_HOME=/app/cache
7
+ ENV TRANSFORMERS_CACHE=/app/cache
8
+ ENV HF_HUB_CACHE=/app/cache
9
+
10
  # Install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
 
17
  # Copy source code
18
  COPY . .
19
 
20
+ # Expose port
21
+ EXPOSE 7860
22
+
23
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]