ftiiii commited on
Commit
768185a
·
verified ·
1 Parent(s): 3f097e5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -5,30 +5,33 @@
5
  # Base image Python nhẹ và ổn định
6
  FROM python:3.10-slim
7
 
8
- # Tránh interactive prompts và output Python buffer
9
  ENV DEBIAN_FRONTEND=noninteractive
10
  ENV PYTHONUNBUFFERED=1
 
11
 
12
- # Matplotlib backend không GUI
13
- ENV MPLBACKEND=Agg
14
-
15
- # Cài dependencies hệ thống cần thiết
16
  RUN apt-get update && \
17
  apt-get install -y --no-install-recommends \
18
  ffmpeg \
19
  libsndfile1 \
20
  build-essential \
21
  wget \
 
 
 
 
 
 
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
- # Copy code vào container
25
  WORKDIR /app
26
  COPY . /app
27
 
28
- # Cài dependencies Python
29
  RUN pip install --no-cache-dir \
30
  gradio==4.26.0 \
31
- tensorflow==2.11.0 \
32
  numpy<2 \
33
  librosa==0.10.1 \
34
  matplotlib \
@@ -38,7 +41,10 @@ RUN pip install --no-cache-dir \
38
  imageio \
39
  pillow
40
 
41
- # Nếu bạn dùng Demucs/Silero VAD, cài thêm:
 
 
 
42
  # RUN pip install --no-cache-dir torch==1.13.1 torchaudio==0.13.1 demucs==4.0.1 silero-vad==5.1.2 soundfile
43
 
44
  # Expose port Gradio
 
5
  # Base image Python nhẹ và ổn định
6
  FROM python:3.10-slim
7
 
8
+ # Tránh interactive prompts và giảm layer size
9
  ENV DEBIAN_FRONTEND=noninteractive
10
  ENV PYTHONUNBUFFERED=1
11
+ ENV MPLBACKEND=Agg # Matplotlib backend không GUI
12
 
13
+ # Cài các dependencies hệ thống cần thiết cho audio và TensorFlow
 
 
 
14
  RUN apt-get update && \
15
  apt-get install -y --no-install-recommends \
16
  ffmpeg \
17
  libsndfile1 \
18
  build-essential \
19
  wget \
20
+ python3-dev \
21
+ libatlas-base-dev \
22
+ gfortran \
23
+ liblapack-dev \
24
+ libblas-dev \
25
+ curl \
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Thiết lập thư mục làm việc
29
  WORKDIR /app
30
  COPY . /app
31
 
32
+ # Cài các package Python nhẹ trước
33
  RUN pip install --no-cache-dir \
34
  gradio==4.26.0 \
 
35
  numpy<2 \
36
  librosa==0.10.1 \
37
  matplotlib \
 
41
  imageio \
42
  pillow
43
 
44
+ # Cài TensorFlow riêng để tránh lỗi build
45
+ RUN pip install --no-cache-dir tensorflow==2.11.0
46
+
47
+ # Nếu bạn cần Demucs / Silero VAD / torch
48
  # RUN pip install --no-cache-dir torch==1.13.1 torchaudio==0.13.1 demucs==4.0.1 silero-vad==5.1.2 soundfile
49
 
50
  # Expose port Gradio