arifardev commited on
Commit
78b9223
·
verified ·
1 Parent(s): e598307

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Menggunakan base image Python 3.10
2
+ FROM python:3.10-slim
3
+
4
+ # Install semua sistem dependency yang dibutuhkan Coqui TTS secara maksimal
5
+ RUN apt-get update && apt-get install -y \
6
+ libsndfile1 \
7
+ espeak-ng \
8
+ ffmpeg \
9
+ build-essential \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Buat dan set working directory
13
+ WORKDIR /app
14
+
15
+ # Mengarahkan semua cache HuggingFace dan Coqui ke /tmp agar sesuai permintaan
16
+ ENV XDG_DATA_HOME=/tmp
17
+ ENV TTS_HOME=/tmp
18
+ ENV HF_HOME=/tmp/huggingface
19
+
20
+ # Install dependencies Python
21
+ COPY requirements.txt .
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Copy source code API
25
+ COPY . .
26
+
27
+ # Expose port yang digunakan Hugging Face (7860)
28
+ EXPOSE 7860
29
+
30
+ # Jalankan server Uvicorn
31
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]