# Menggunakan base image Python 3.10 FROM python:3.10-slim # Install semua sistem dependency yang dibutuhkan Coqui TTS secara maksimal RUN apt-get update && apt-get install -y \ libsndfile1 \ espeak-ng \ ffmpeg \ build-essential \ && rm -rf /var/lib/apt/lists/* # Buat dan set working directory WORKDIR /app # Mengarahkan semua cache HuggingFace dan Coqui ke /tmp agar sesuai permintaan ENV XDG_DATA_HOME=/tmp ENV TTS_HOME=/tmp ENV HF_HOME=/tmp/huggingface # Install dependencies Python COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy source code API COPY . . # Expose port yang digunakan Hugging Face (7860) EXPOSE 7860 # Jalankan server Uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]