FROM python:3.11-slim WORKDIR /app COPY ./requirements.txt /app/requirements.txt RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt COPY ./app.py /app/ # Hugging Face 要求对外暴露 7860 端口 EXPOSE 7860 # 直接运行 uvicorn,监听对外的主端口 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]