DegenGamer1702 commited on
Commit
969f04d
·
verified ·
1 Parent(s): 825e068

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -11
Dockerfile CHANGED
@@ -1,35 +1,54 @@
1
- # ============================================================
2
- # GPU-ENABLED SELF-CONTAINED IMAGE FOR DEEPFAKE VIDEO DETECTOR
3
- # ============================================================
4
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
 
5
  ENV DEBIAN_FRONTEND=noninteractive \
6
  PYTHONDONTWRITEBYTECODE=1 \
7
  PYTHONUNBUFFERED=1
8
 
9
- # Force reinstall Gradio 4.44.1 every time (avoids cache)
 
 
10
  ARG GRADIO_FORCE_REINSTALL=1
11
  RUN pip install --no-cache-dir --upgrade gradio==4.44.1
12
 
13
-
14
- # System deps for OpenCV + dlib
 
15
  RUN apt-get update && apt-get install -y --no-install-recommends \
16
- build-essential cmake \
17
  libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  WORKDIR /app
21
 
22
- # Copy app + requirements
 
 
23
  COPY requirements.txt /app/requirements.txt
24
  COPY app.py /app/app.py
25
-
26
- # ✅ Copy your model + landmark file directly into the image
27
  COPY models /app/models
28
  COPY shape_predictor_68_face_landmarks.dat /app/
29
 
30
- # Install TensorFlow (GPU-capable) + requirements
 
 
31
  RUN pip install --no-cache-dir tensorflow==2.18.0
32
  RUN pip install --no-cache-dir -r requirements.txt
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  EXPOSE 7860
35
  CMD ["python", "app.py"]
 
1
+ # =======================================================
2
+ # GPU-enabled base image (CUDA 12.1 + cuDNN 8)
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
+ # =======================================================
11
+ # Install Gradio first (pinned version)
12
+ # =======================================================
13
  ARG GRADIO_FORCE_REINSTALL=1
14
  RUN pip install --no-cache-dir --upgrade gradio==4.44.1
15
 
16
+ # =======================================================
17
+ # System dependencies for OpenCV + dlib runtime
18
+ # =======================================================
19
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
20
  libgl1 libglib2.0-0 libsm6 libxext6 libxrender1 \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
  WORKDIR /app
24
 
25
+ # =======================================================
26
+ # Copy application files
27
+ # =======================================================
28
  COPY requirements.txt /app/requirements.txt
29
  COPY app.py /app/app.py
 
 
30
  COPY models /app/models
31
  COPY shape_predictor_68_face_landmarks.dat /app/
32
 
33
+ # =======================================================
34
+ # Install Python dependencies
35
+ # =======================================================
36
  RUN pip install --no-cache-dir tensorflow==2.18.0
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
39
+ # 🔧 Replace compiled dlib with prebuilt dlib-bin
40
+ RUN pip uninstall -y dlib || true \
41
+ && pip install --no-cache-dir dlib-bin==19.24.2
42
+
43
+ # =======================================================
44
+ # Environment optimizations
45
+ # =======================================================
46
+ ENV OMP_NUM_THREADS=2 \
47
+ MKL_NUM_THREADS=2 \
48
+ OPENBLAS_NUM_THREADS=2 \
49
+ NUMEXPR_NUM_THREADS=2 \
50
+ TF_CPP_MIN_LOG_LEVEL=2 \
51
+ CUDA_VISIBLE_DEVICES=0
52
+
53
  EXPOSE 7860
54
  CMD ["python", "app.py"]