FROM python:3.10-slim # 更换系统源 # 科大大的 Debian 12 (bookworm) 镜像源 RUN echo "deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free" > /etc/apt/sources.list && \ echo "deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb http://mirrors.ustc.edu.cn/debian-security bookworm-security main" >> /etc/apt/sources.list && \ echo "deb http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free" >> /etc/apt/sources.list # 安装系统依赖 RUN apt-get update && apt-get install -y \ build-essential \ libsndfile1 \ ffmpeg \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # 安装Python依赖 COPY ../requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple # 复制应用代码 COPY ../src/ /app/src/ COPY ../logs/ /app/logs/ COPY ../main.py /app/ # 设置环境变量 ENV SPEAKERS_URL="http://172.23.30.120:11200/api/v1/speakers/" \ LOG_LEVEL="INFO" \ LOG_LEVEL_ASR_SERVER="INFO" # 暴露WebSocket端口 EXPOSE 11096 # 启动服务 CMD ["python", "main.py"]