aniudupa commited on
Commit
9750de9
·
verified ·
1 Parent(s): e09e86c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -25
Dockerfile CHANGED
@@ -1,37 +1,25 @@
1
- FROM python:3.10
 
2
 
3
- # Install dependencies required for building dlib and face_recognition
4
  RUN apt-get update && apt-get install -y \
5
  build-essential \
6
  cmake \
 
7
  libopenblas-dev \
8
  liblapack-dev \
9
  libx11-dev \
10
- libgtk-3-dev \
11
- libboost-all-dev \
12
- libgl1-mesa-glx \
13
- libglib2.0-0 \
14
- wget \
15
- git \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Optional: Install dlib prerequisites manually if needed
19
- # RUN pip install cmake
20
-
21
- # Set working directory
22
  WORKDIR /app
 
23
 
24
- # Copy requirements and app
25
- COPY requirements.txt .
26
- COPY app ./app
27
-
28
- # Upgrade pip & install dependencies
29
- RUN pip install --upgrade pip setuptools wheel
30
- RUN pip install --use-pep517 --no-cache-dir -r requirements.txt
31
-
32
-
33
- # Expose FastAPI port
34
- EXPOSE 7860
35
 
36
- # Run the app
37
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ # Use the official Python 3.10 slim image as the base
2
+ FROM python:3.10-slim
3
 
4
+ # Install dependencies for dlib, face_recognition, and FastAPI
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
8
+ libboost-all-dev \
9
  libopenblas-dev \
10
  liblapack-dev \
11
  libx11-dev \
12
+ python3-dev \
 
 
 
 
 
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Install Python dependencies from requirements.txt
16
+ COPY requirements.txt /app/requirements.txt
 
 
17
  WORKDIR /app
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy the application files
21
+ COPY . /app
 
 
 
 
 
 
 
 
 
22
 
23
+ # Expose port and run FastAPI using Uvicorn
24
+ EXPOSE 10000
25
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]