abdullahalioo commited on
Commit
6b40661
·
verified ·
1 Parent(s): d8b5a71

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -3
Dockerfile CHANGED
@@ -1,11 +1,23 @@
1
- FROM python:3.10
2
 
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
- RUN pip install -r requirements.txt
7
 
 
8
  COPY . .
9
 
10
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
11
 
 
 
 
 
1
+ FROM python:3.10-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ build-essential \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Install Python dependencies early for caching
12
  COPY requirements.txt .
13
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy application code
16
  COPY . .
17
 
18
+ # Expose port (optional)
19
+ EXPOSE 7860
20
 
21
+
22
+ # Run Uvicorn server
23
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]