# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker # you will also find guides on how best to write your Dockerfile FROM python:3.9-slim # 设置工作目录 WORKDIR /app # 复制应用代码 COPY . . RUN pip install --no-cache-dir --upgrade -r requirements.txt # 暴露端口 EXPOSE 5200 # 健康检查 HEALTHCHECK --interval=30s --timeout=5s \ CMD curl -f http://localhost:5200/v1/models || exit 1 # 运行应用 CMD ["python", "app.py"]