danieaneta commited on
Commit
db50748
·
1 Parent(s): bda2594

update docker

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -12
Dockerfile CHANGED
@@ -1,20 +1,22 @@
1
- # Use official Python image
2
- FROM python:3.10
3
-
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy dependencies
8
- COPY requirements.txt .
 
 
 
 
 
 
9
 
10
  # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
 
12
 
13
- # Copy the application code
14
  COPY . .
15
 
16
- # Expose API port
17
- EXPOSE 7860
18
 
19
- # Run FastAPI server
20
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.10-slim
 
 
 
2
  WORKDIR /app
3
 
4
+ # Set environment variables for caches
5
+ ENV MPLCONFIGDIR=/app/matplotlib_cache
6
+ ENV TRANSFORMERS_CACHE=/app/transformers_cache
7
+ ENV HOME=/app
8
+
9
+ # Create directories
10
+ RUN mkdir -p /app/matplotlib_cache
11
+ RUN mkdir -p /app/transformers_cache
12
 
13
  # Install dependencies
14
+ COPY requirements.txt .
15
+ RUN pip install -r requirements.txt
16
 
17
+ # Copy your application files
18
  COPY . .
19
 
20
+ # Command to run your application
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
22