Ricky01anjay commited on
Commit
537edea
·
verified ·
1 Parent(s): 14b0ed7

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]