FROM python:3.10 # 安装系统依赖 RUN apt-get update && apt-get install -y \ git \ cmake \ build-essential \ zlib1g-dev \ libaio-dev \ pkg-config \ && rm -rf /var/lib/apt/lists/* RUN pip install -U --no-cache-dir \ cmake==4.0.3 \ pybind11==2.13.6 \ spacy==3.5.0 \ torch==1.13.1 # 复制依赖文件 COPY requirements.txt . # 安装 Python 依赖 RUN pip install -r requirements.txt RUN pip install -U --no-cache-dir \ numpy==1.24.1 # 下载 spaCy 模型 RUN python -m spacy download en_core_web_sm # 安装 ffrecord 库 RUN pip install git+https://github.com/HFAiLab/ffrecord.git # 设置工作目录 WORKDIR /app # 复制应用文件 COPY . . # 复制应用代码 COPY . . ENV PYTHONPATH=/app ENV GRADIO_SERVER_NAME=0.0.0.0 ENV GRADIO_SERVER_PORT=7860 EXPOSE 7860 CMD ["python", "app.py"]