aniudupa commited on
Commit
c36d8f5
·
1 Parent(s): 5be65dc

docker added:

Browse files
Files changed (3) hide show
  1. Dockerfile +29 -10
  2. app.py → app/main.py +0 -0
  3. requirements.txt +1 -2
Dockerfile CHANGED
@@ -1,17 +1,36 @@
1
- # Use official Python base image
2
- FROM python:3.10
3
 
4
- # Set working directory
5
- WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- # Copy files
8
- COPY . /app
 
9
 
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
12
 
13
- # Expose FastAPI default port
14
  EXPOSE 7860
15
 
16
- # Run the FastAPI app using uvicorn
17
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9-slim
 
2
 
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ cmake \
7
+ libgtk-3-dev \
8
+ libboost-all-dev \
9
+ libopenblas-dev \
10
+ liblapack-dev \
11
+ libx11-dev \
12
+ libsm6 \
13
+ libxext6 \
14
+ libxrender-dev \
15
+ git \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Install dlib (required for face_recognition)
19
+ RUN pip install --upgrade pip
20
+ RUN pip install dlib
21
 
22
+ # Install Python dependencies
23
+ COPY requirements.txt .
24
+ RUN pip install -r requirements.txt
25
 
26
+ # Copy app code
27
+ COPY app/ /app/
28
+
29
+ # Set working directory
30
+ WORKDIR /app
31
 
32
+ # Expose port
33
  EXPOSE 7860
34
 
35
+ # Run the app
36
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
app.py → app/main.py RENAMED
File without changes
requirements.txt CHANGED
@@ -2,5 +2,4 @@ fastapi
2
  uvicorn
3
  numpy
4
  face_recognition
5
- Pillow
6
- python-multipart
 
2
  uvicorn
3
  numpy
4
  face_recognition
5
+ pillow