Spaces:
Sleeping
Sleeping
| # 使用 python:3.10.9-slim 作为基础镜像 | |
| FROM python:3.10.9-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 复制当前目录内容到容器内的 /app 目录 | |
| COPY . /app | |
| ENV INDEX_HTML=/app/index.html | |
| RUN --mount=type=secret,id=PLAYER_SCRIPT,mode=0444,required=true \ | |
| cat /run/secrets/PLAYER_SCRIPT > /app/player.py && chmod 755 /app/player.py | |
| RUN --mount=type=secret,id=HTML_SCRIPT,mode=0444,required=true \ | |
| cat /run/secrets/HTML_SCRIPT > $INDEX_HTML && chmod 755 $INDEX_HTML | |
| # 安装crontab和其他依赖 | |
| RUN apt-get update && apt-get install -y cron wget git && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| CMD uvicorn player:app --host 0.0.0.0 --port 7860 |