LovnishVerma commited on
Commit
5870bc7
·
verified ·
1 Parent(s): 71a3009

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -57
Dockerfile CHANGED
@@ -1,67 +1,28 @@
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
- openai-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"]
 
1
+ # Use Python 3.10
 
 
2
  FROM python:3.10-slim
3
 
4
+ # Install FFmpeg (Required for audio processing)
5
+ RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
6
 
7
+ # Set up a user (Hugging Face prefers non-root)
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
 
13
+ WORKDIR $HOME/app
 
 
 
 
 
 
14
 
15
+ # Copy files
16
+ COPY --chown=user . $HOME/app
17
 
18
+ # Install dependencies
19
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
20
 
21
+ # Create the jobs directory with correct permissions
22
+ RUN mkdir -p jobs
 
 
 
23
 
24
+ # Expose the Hugging Face port
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  EXPOSE 7860
26
 
27
+ # Run the app
28
+ CMD ["python", "app.py"]