Spaces:
Paused
Paused
Download Dockerfile from tianlong12/Zed2API: direct link, hf CLI and curl.
- Browser
- Download file 501 Bytes
-
https://huggingface.co/spaces/tianlong12/Zed2API/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/tianlong12/Zed2API/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tianlong12/Zed2API/resolve/main/Dockerfile
501 Bytes
| # 使用官方Python运行时作为父镜像 | |
| FROM python:3.9-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 复制 requirements.txt 文件 | |
| COPY requirements.txt . | |
| # 安装项目依赖 | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 将当前目录内容复制到容器的/app目录 | |
| COPY . . | |
| # 设置环境变量 | |
| ENV FLASK_APP=app.py | |
| ENV FLASK_RUN_HOST=0.0.0.0 | |
| # 暴露端口7860,这是Hugging Face Spaces使用的默认端口 | |
| EXPOSE 7860 | |
| # 运行Flask应用 | |
| CMD ["flask", "run", "--port=7860"] |