DegenGamer1702 commited on
Commit
feaee3c
·
verified ·
1 Parent(s): 511b8a3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -52
Dockerfile CHANGED
@@ -1,58 +1,36 @@
1
- # ------------------------------------------------------
2
- # BASE IMAGE: Includes PyTorch + CUDA + cuDNN runtime
3
- # ------------------------------------------------------
4
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
5
 
6
- # ------------------------------------------------------
7
- # ✅ Set working directory
8
- # ------------------------------------------------------
9
- WORKDIR /app
10
- COPY . .
 
 
 
11
 
12
- # ------------------------------------------------------
13
- # ✅ Install minimal system deps (needed by OpenCV & dlib)
14
- # ------------------------------------------------------
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
- libgl1 libglib2.0-0 && \
17
- rm -rf /var/lib/apt/lists/*
18
-
19
- # ------------------------------------------------------
20
- # ✅ Install all Python dependencies (pinned + GPU safe)
21
- # ------------------------------------------------------
22
- RUN pip install --no-cache-dir \
23
- tensorflow==2.18.0 \
24
- torch==2.2.2 \
25
- torchvision==0.17.2 \
26
- facenet-pytorch==2.6.0 \
27
- opencv-python \
28
- imutils \
29
- dlib-bin==19.24.6 \
30
- gradio==4.42.0 \
31
- scipy \
32
- "numpy<2.0"
33
-
34
- # ------------------------------------------------------
35
- # ✅ Environment tuning
36
- # ------------------------------------------------------
37
- # Safe OpenMP threads (integer only)
38
- ENV OMP_NUM_THREADS=4
39
- ENV MKL_NUM_THREADS=4
40
-
41
- # Disable OneDNN auto-tuning (stabilizes TF startup)
42
- ENV TF_ENABLE_ONEDNN_OPTS=0
43
-
44
- # Redirect Matplotlib config to a writable temp directory
45
- ENV MPLCONFIGDIR=/tmp/matplotlib
46
-
47
- # Prevent Python stdout buffering (helps Gradio logs)
48
- ENV PYTHONUNBUFFERED=1
49
-
50
- # ------------------------------------------------------
51
- # ✅ Expose the Gradio port
52
- # ------------------------------------------------------
53
- EXPOSE 7860
54
 
55
- # ------------------------------------------------------
56
- # Launch the app
57
- # ------------------------------------------------------
 
 
58
  CMD ["python", "app.py"]
 
1
+ # ============================================================
2
+ # GPU-ENABLED SELF-CONTAINED IMAGE FOR DEEPFAKE VIDEO DETECTOR
3
+ # ============================================================
4
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
5
 
6
+ ENV DEBIAN_FRONTEND=noninteractive \
7
+ PYTHONDONTWRITEBYTECODE=1 \
8
+ PYTHONUNBUFFERED=1
9
+
10
+ # Force reinstall Gradio 4.44.1 every time (avoids cache)
11
+ ARG GRADIO_FORCE_REINSTALL=1
12
+ RUN pip install --no-cache-dir --upgrade gradio==4.44.1
13
+
14
 
15
+ # System deps for OpenCV + dlib
 
 
16
  RUN apt-get update && apt-get install -y --no-install-recommends \
17
+ build-essential cmake \
18
+ libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ WORKDIR /app
22
+
23
+ # Copy app + requirements
24
+ COPY requirements.txt /app/requirements.txt
25
+ COPY app.py /app/app.py
26
+
27
+ # ✅ Copy your model + landmark file directly into the image
28
+ COPY models /app/models
29
+ COPY shape_predictor_68_face_landmarks.dat /app/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ # Install TensorFlow (GPU-capable) + requirements
32
+ RUN pip install --no-cache-dir tensorflow==2.18.0
33
+ RUN pip install --no-cache-dir -r requirements.txt
34
+
35
+ EXPOSE 7860
36
  CMD ["python", "app.py"]