Ricky01anjay commited on
Commit
7adb260
·
verified ·
1 Parent(s): d26d714

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ # 1. Install System Dependencies (FFmpeg, ImageMagick, & Font Linux)
4
+ RUN apt-get update && apt-get install -y \
5
+ ffmpeg \
6
+ imagemagick \
7
+ fonts-dejavu \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 2. Fix ImageMagick Security Policy (Mencegah Error MoviePy saat membuat Subtitle)
11
+ RUN sed -i 's/<policy domain="path" rights="none" pattern="@\*"\/>/<!-- <policy domain="path" rights="none" pattern="@\*"\/> -->/g' /etc/ImageMagick-6/policy.xml
12
+
13
+ # 3. Set direktori kerja
14
+ WORKDIR /app
15
+
16
+ # 4. Install Python Dependencies Langsung (Tanpa requirements.txt)
17
+ RUN pip install --no-cache-dir flask requests faster-whisper moviepy==1.0.3 werkzeug
18
+
19
+ # 5. Copy semua file aplikasi ke dalam container
20
+ COPY . .
21
+
22
+ # 6. Buat folder untuk memproses video & berikan akses penuh (Wajib di HuggingFace)
23
+ RUN mkdir -p downloads && chmod -R 777 /app
24
+
25
+ # 7. Expose Port standar HuggingFace
26
+ EXPOSE 7860
27
+
28
+ # 8. Jalankan Aplikasi
29
+ CMD ["python", "app.py"]