ftiiii commited on
Commit
2c2f938
·
verified ·
1 Parent(s): 0a7242a

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -0
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # =========================
2
+ # Dockerfile cho app Gradio âm thanh
3
+ # =========================
4
+
5
+ # Base image Python nhẹ và ổn định
6
+ FROM python:3.10-slim
7
+
8
+ # Tránh interactive prompts và reduce layer size
9
+ ENV DEBIAN_FRONTEND=noninteractive
10
+ ENV PYTHONUNBUFFERED=1
11
+ ENV MPLBACKEND=Agg # Matplotlib backend không GUI
12
+
13
+ # Cài dependencies hệ thống cần thiết
14
+ RUN apt-get update && \
15
+ apt-get install -y --no-install-recommends \
16
+ ffmpeg \
17
+ libsndfile1 \
18
+ build-essential \
19
+ wget \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ # Copy code vào container
23
+ WORKDIR /app
24
+ COPY . /app
25
+
26
+ # Cài dependencies Python
27
+ RUN pip install --no-cache-dir \
28
+ gradio==4.26.0 \
29
+ tensorflow==2.11.0 \
30
+ numpy<2 \
31
+ librosa==0.10.1 \
32
+ matplotlib \
33
+ pywavelets \
34
+ scikit-learn \
35
+ joblib \
36
+ imageio \
37
+ pillow
38
+
39
+ # Nếu bạn dùng Demucs/Silero VAD, cài thêm:
40
+ # RUN pip install --no-cache-dir torch==1.13.1 torchaudio==0.13.1 demucs==4.0.1 silero-vad==5.1.2 soundfile
41
+
42
+ # Expose port Gradio
43
+ EXPOSE 7860
44
+
45
+ # Command chạy app
46
+ CMD ["python", "appy.py"]