hayou2002 commited on
Commit
cb121e1
·
verified ·
1 Parent(s): 9675c2a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,21 +1,27 @@
1
- # ================ OpenList最新版(正确项目名)HF Docker部署 ================
 
2
  FROM python:3.11-slim
3
  WORKDIR /app
4
  USER root
5
 
6
- # 1. 安装系统依赖+正确的OpenList包(包名是openlist,不是openlit)
7
  RUN apt-get update && \
8
- apt-get install -y --no-install-recommends curl && \
9
- rm -rf /var/lib/apt/lists/* && \
10
- pip install --no-cache-dir openlist
11
 
12
- # 2. HF持久化目录(文件重启不丢失)
 
 
 
 
 
 
13
  RUN mkdir -p /data/uploads && chmod -R 777 /data
14
  ENV OPENLIST_DATA_DIR=/data
15
  VOLUME ["/data"]
16
 
17
- # 3. HF适配端口
18
  EXPOSE 7860
19
 
20
- # 4. 启动命令:使用正确的可执行文件(openlist,非openlit)
21
- CMD ["/usr/local/bin/openlist", "serve", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/v1"]
 
1
+ # ================ OpenList最新版【源码级部署·必成功】 ================
2
+ # 步骤1:基础Python环境(兼容项目依赖)
3
  FROM python:3.11-slim
4
  WORKDIR /app
5
  USER root
6
 
7
+ # 步骤2:安装系统依赖(克隆源码必需)
8
  RUN apt-get update && \
9
+ apt-get install -y --no-install-recommends git && \
10
+ rm -rf /var/lib/apt/lists/*
 
11
 
12
+ # 步骤3:克隆OpenList官方源码(确保获取完整项目)
13
+ RUN git clone --depth=1 https://github.com/openlistteam/openlist.git .
14
+
15
+ # 步骤4:安装项目依赖+项目本身(确保可执行模块存在)
16
+ RUN pip install --no-cache-dir -e .
17
+
18
+ # 步骤5:HF持久化配置(文件重启不丢失)
19
  RUN mkdir -p /data/uploads && chmod -R 777 /data
20
  ENV OPENLIST_DATA_DIR=/data
21
  VOLUME ["/data"]
22
 
23
+ # 步骤6:HF适配端口
24
  EXPOSE 7860
25
 
26
+ # 步骤7:启动命令(通过Python模块调用,彻底避开可执行文件路径问题)
27
+ CMD ["python", "-m", "openlist.serve", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/v1"]