tayyabimam commited on
Commit
9097bc3
·
verified ·
1 Parent(s): a04b0bc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -35
Dockerfile CHANGED
@@ -1,35 +1,37 @@
1
- FROM python:3.9-slim
2
-
3
- WORKDIR /app
4
-
5
- # System dependencies for face_recognition
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- cmake \
9
- libsm6 \
10
- libxext6 \
11
- libxrender-dev \
12
- libgl1-mesa-glx \
13
- git \
14
- curl \
15
- && apt-get clean && rm -rf /var/lib/apt/lists/*
16
-
17
- # Copy server files
18
- COPY server/ ./server/
19
-
20
- # Install Python requirements
21
- WORKDIR /app/server
22
- RUN pip install --no-cache-dir -r requirements.txt
23
- RUN pip install face-recognition opencv-python-headless matplotlib fastapi uvicorn python-multipart
24
-
25
- # Create necessary directories
26
- RUN mkdir -p uploaded_images
27
- RUN mkdir -p static
28
- RUN mkdir -p models
29
- RUN mkdir -p uploaded_videos
30
-
31
- # Expose the port
32
- EXPOSE 7860
33
-
34
- # Start the server
35
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # System dependencies for face_recognition
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ cmake \
9
+ libsm6 \
10
+ libxext6 \
11
+ libxrender-dev \
12
+ libgl1-mesa-glx \
13
+ git \
14
+ curl \
15
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Create necessary directories
18
+ RUN mkdir -p uploaded_images
19
+ RUN mkdir -p static
20
+ RUN mkdir -p models
21
+ RUN mkdir -p uploaded_videos
22
+
23
+ # Install Python requirements
24
+ RUN pip install fastapi uvicorn python-multipart face-recognition opencv-python-headless matplotlib torch torchvision numpy pillow
25
+
26
+ # Download model from Hugging Face
27
+ RUN pip install huggingface_hub
28
+ RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='tayyabimam/Deepfake', filename='model.pt', local_dir='/app/models')"
29
+
30
+ # Copy app.py
31
+ COPY app.py ./
32
+
33
+ # Expose the port
34
+ EXPOSE 7860
35
+
36
+ # Start the server
37
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]