Syahhh01 commited on
Commit
75b6f7b
·
verified ·
1 Parent(s): c7052e1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,27 +1,28 @@
1
- # Menggunakan image Python 3.10 versi slim agar ukurannya lebih kecil
2
  FROM python:3.10-slim
3
 
4
- # Menentukan direktori kerja di dalam container
5
  WORKDIR /code
6
 
7
- # --- BAGIAN PENTING UNTUK AUDIO ---
8
- # Menginstal dependensi sistem Linux yang dibutuhkan oleh soundfile & torchaudio
9
  RUN apt-get update && apt-get install -y \
10
  libsndfile1 \
 
11
  && rm -rf /var/lib/apt/lists/*
12
- # ----------------------------------
13
 
14
- # Menyalin file requirements.txt ke dalam container
15
  COPY requirements.txt .
16
 
17
- # Menginstal dependensi Python tanpa menyimpan cache (agar image tetap kecil)
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Menyalin seluruh kode aplikasi (app.py, model .pth, dll) ke direktori /code
21
  COPY . .
22
 
23
- # Membuka port 7860 (Standar untuk Hugging Face Spaces)
24
  EXPOSE 7860
25
 
26
- # Menjalankan aplikasi FastAPI menggunakan Uvicorn
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Menggunakan image Python 3.10 versi slim
2
  FROM python:3.10-slim
3
 
4
+ # Menentukan direktori kerja
5
  WORKDIR /code
6
 
7
+ # --- BAGIAN PENTING UNTUK AUDIO & CODEC ---
8
+ # Menambahkan 'ffmpeg' ke dalam daftar instalasi
9
  RUN apt-get update && apt-get install -y \
10
  libsndfile1 \
11
+ ffmpeg \
12
  && rm -rf /var/lib/apt/lists/*
13
+ # ------------------------------------------
14
 
15
+ # Menyalin file requirements
16
  COPY requirements.txt .
17
 
18
+ # Menginstal dependensi Python
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Menyalin seluruh kode aplikasi
22
  COPY . .
23
 
24
+ # Membuka port
25
  EXPOSE 7860
26
 
27
+ # Menjalankan aplikasi
28
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]