CoolFace
Apppublic

response000/apis

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes
Dockerfile22 linesDownload Raw Back to root
1# 基础镜像,可以根据你的需求选择。如果需要GPU支持,选择带cuda的基础镜像。2# 例如:nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.043FROM python:3.124 5# 设置工作目录6WORKDIR /app7 8# 复制你的依赖文件并安装9# 这是一种最佳实践,因为只有当 requirements.txt 改变时,pip install 这层缓存才会被重新构建。10COPY requirements.txt .11RUN pip install --no-cache-dir -r requirements.txt12 13# 复制你的应用代码14# 这将把你的 app.py 和其他所有文件复制到容器中15COPY . .16 17# 暴露端口,这是 Hugging Face Spaces 的默认端口18EXPOSE 786019 20# 启动命令21# 这里的 app:app 对应你的 app.py 文件和 FastAPI 实例名称22CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]