Spaces:
Sleeping
Sleeping
Download Dockerfile from upapp/mylist: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/upapp/mylist/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/upapp/mylist/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/upapp/mylist/resolve/main/Dockerfile
1.03 kB
| # 使用官方 OpenList 作为基础镜像 | |
| FROM openlistteam/openlist:latest | |
| USER root | |
| # 安装基础依赖包 (Alpine 环境) | |
| RUN apk add --no-cache python3 py3-pip tar bash curl && \ | |
| pip3 install --no-cache-dir "huggingface_hub[cli]" --break-system-packages | |
| # 创建数据目录,并将所有权赋予用户 (UID 1000) | |
| RUN mkdir -p /opt/openlist/data && \ | |
| chown -R 1000:1000 /opt/openlist && \ | |
| chmod -R 777 /opt/openlist | |
| # 拷贝并配置备份恢复脚本 | |
| COPY ./restore.sh /restore.sh | |
| RUN chmod +x /restore.sh && chown 1000:1000 /restore.sh | |
| # 暴露 OpenList 默认端口 5244 | |
| EXPOSE 5244 | |
| ENV PORT=5244 | |
| ENV TZ=Asia/Shanghai | |
| # 【核心修改】:显式声明用户的 HOME 目录与 Huggingface 的缓存目录 | |
| # 让 hf 命令行工具把所有的临时日志、缓存、块数据全部写入我们有权限的目录中 | |
| ENV HOME=/opt/openlist | |
| ENV HF_HOME=/opt/openlist/.cache | |
| # 切换回低权限用户 1000 运行 | |
| USER 1000 | |
| # 将脚本作为容器的主入口 | |
| ENTRYPOINT ["/bin/bash", "/restore.sh"] |