File size: 773 Bytes
78b9223 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # 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"] |