Tanxshh commited on
Commit
6297cbe
·
verified ·
1 Parent(s): 9b81991

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -1,12 +1,22 @@
 
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
7
 
8
- COPY . .
 
 
9
 
 
10
  EXPOSE 7860
11
 
 
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Base image with Python
2
  FROM python:3.10-slim
3
 
4
+ # Set environment variables to avoid cache permission issues
5
+ ENV TRANSFORMERS_CACHE=/app/cache
6
+ ENV HF_HOME=/app/cache
7
+
8
+ # Set working directory
9
  WORKDIR /app
10
 
11
+ # Copy your code
12
+ COPY . /app
13
 
14
+ # Install dependencies
15
+ RUN pip install --upgrade pip
16
+ RUN pip install fastapi uvicorn python-multipart sentence-transformers torch pandas PyMuPDF
17
 
18
+ # Expose port
19
  EXPOSE 7860
20
 
21
+ # Run FastAPI server
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]