Ricky01anjay commited on
Commit
77b30b8
·
verified ·
1 Parent(s): 1ec94e9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -16
Dockerfile CHANGED
@@ -1,42 +1,29 @@
1
- # Gunakan image Python yang ramping
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONUNBUFFERED=1
6
- ENV PYTHONDONTWRITEBYTECODE=1
7
 
8
- # Tentukan direktori kerja
9
  WORKDIR /app
10
 
11
- # 1. Install dependencies sistem (FFmpeg sangat penting untuk MoviePy)
12
- # git diperlukan jika whisper perlu mendownload model tertentu
13
  RUN apt-get update && apt-get install -y \
14
  ffmpeg \
15
  git \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # 2. Install library Python secara langsung (Tanpa requirements.txt)
19
  RUN pip install --no-cache-dir \
20
  flask \
21
  werkzeug \
22
- moviepy \
 
23
  openai-whisper \
24
  edge-tts \
25
- requests \
26
- asyncio
27
 
28
- # 3. Pre-download Model Whisper (Agar tidak download saat aplikasi jalan)
29
- # Kita gunakan model 'base' karena cocok untuk spesifikasi CPU & RAM 16GB
30
  RUN python -c "import whisper; whisper.load_model('base')"
31
 
32
- # 4. Copy file aplikasi ke dalam container
33
  COPY app.py .
34
 
35
- # 5. Buat folder uploads dengan permission yang benar
36
  RUN mkdir -p uploads && chmod 777 uploads
37
 
38
- # 6. Expose port sesuai permintaan
39
  EXPOSE 7860
40
 
41
- # 7. Jalankan aplikasi
42
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  ENV PYTHONUNBUFFERED=1
 
4
 
 
5
  WORKDIR /app
6
 
 
 
7
  RUN apt-get update && apt-get install -y \
8
  ffmpeg \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  RUN pip install --no-cache-dir \
13
  flask \
14
  werkzeug \
15
+ "moviepy<2.0.0" \
16
+ decorator \
17
  openai-whisper \
18
  edge-tts \
19
+ requests
 
20
 
 
 
21
  RUN python -c "import whisper; whisper.load_model('base')"
22
 
 
23
  COPY app.py .
24
 
 
25
  RUN mkdir -p uploads && chmod 777 uploads
26
 
 
27
  EXPOSE 7860
28
 
 
29
  CMD ["python", "app.py"]