FROM python:3.11-slim

WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    ffmpeg \
    curl \
    wget \
    && rm -rf /var/lib/apt/lists/*

# 安装 IndexTTS
RUN pip install --no-cache-dir indextts torch numpy scipy soundfile

# 创建音频输出目录
RUN mkdir -p /app/output

# 复制应用代码
COPY server.py /app/server.py

EXPOSE 8000

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
    CMD curl -f http://localhost:8000/health || exit 1

CMD ["python3", "server.py"]
