LovnishVerma commited on
Commit
4318cc3
·
verified ·
1 Parent(s): 944bf22

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +67 -0
Dockerfile ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # =====================================================
2
+ # BASE IMAGE — Python with system tools
3
+ # =====================================================
4
+ FROM python:3.10-slim
5
+
6
+ # -----------------------------------------------------
7
+ # SYSTEM DEPENDENCIES — required for yt-dlp + whisper
8
+ # -----------------------------------------------------
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ ffmpeg \
11
+ curl \
12
+ git \
13
+ build-essential \
14
+ libsndfile1 \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # -----------------------------------------------------
18
+ # OPTIONAL CUDA CHECK (CPU will still work)
19
+ # Huggingface CPU-only by default
20
+ # -----------------------------------------------------
21
+
22
+ # -----------------------------------------------------
23
+ # ENV
24
+ # -----------------------------------------------------
25
+ ENV PYTHONUNBUFFERED=1 \
26
+ PORT=7860 \
27
+ HF_ALLOW_CODE_EXECUTION=1 \
28
+ PIP_NO_CACHE_DIR=1
29
+
30
+ WORKDIR /workspace
31
+
32
+ # -----------------------------------------------------
33
+ # COPY APP
34
+ # -----------------------------------------------------
35
+ COPY . /workspace
36
+
37
+ # -----------------------------------------------------
38
+ # PYTHON DEPENDENCIES
39
+ # -----------------------------------------------------
40
+ # Create lock for deterministic builds (recommended)
41
+ RUN pip install --upgrade pip setuptools wheel
42
+
43
+ # Core libs (NOTE: whisper & sentence-transformers install pytorch)
44
+ RUN pip install \
45
+ torch \
46
+ torchvision \
47
+ torchaudio \
48
+ yt-dlp \
49
+ whisper \
50
+ sentence-transformers \
51
+ transformers \
52
+ flask \
53
+ python-docx \
54
+ reportlab \
55
+ numpy \
56
+ scipy
57
+
58
+ # -----------------------------------------------------
59
+ # FINAL EXPOSE
60
+ # -----------------------------------------------------
61
+ EXPOSE 7860
62
+
63
+ # -----------------------------------------------------
64
+ # LAUNCH
65
+ # HuggingFace calls the app with this command
66
+ # -----------------------------------------------------
67
+ CMD ["python", "app.py"]