HuggingFace0920 commited on
Commit
ce2e827
·
verified ·
1 Parent(s): 00d5c5a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -15,20 +15,24 @@ RUN apt-get update && \
15
  # 设置工作目录
16
  WORKDIR /OpenList
17
 
18
- VOLUME /OpenList
19
-
20
- # 下载并解压 OpenList (通用可靠方法)
21
  RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
22
  tar -xzf openlist-linux-amd64.tar.gz && \
23
- # 查找并解压内层tar文件
24
- find . -type f -name "*.tar" -exec tar -xf {} \; && \
25
- # 查找并移动可执行文件
26
  find . -type f -name "openlist" -exec mv {} . \; && \
27
- # 清理所有临时文件
28
  rm -rf openlist-linux-amd64.tar.gz *linux-amd64*
29
 
30
- # 设置权限
 
 
 
 
31
  RUN chmod 755 openlist
32
 
 
 
 
 
 
 
33
  # 启动服务
34
  CMD ["./openlist", "server"]
 
15
  # 设置工作目录
16
  WORKDIR /OpenList
17
 
18
+ # 下载并解压 OpenList
 
 
19
  RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
20
  tar -xzf openlist-linux-amd64.tar.gz && \
 
 
 
21
  find . -type f -name "openlist" -exec mv {} . \; && \
 
22
  rm -rf openlist-linux-amd64.tar.gz *linux-amd64*
23
 
24
+ # 创建数据目录并设置权限
25
+ RUN mkdir -p /OpenList/data && \
26
+ chmod -R 777 /OpenList/data
27
+
28
+ # 设置可执行权限
29
  RUN chmod 755 openlist
30
 
31
+ # 设置非root用户运行(增强安全性)
32
+ RUN useradd -m openlistuser && \
33
+ chown -R openlistuser:openlistuser /OpenList
34
+
35
+ USER openlistuser
36
+
37
  # 启动服务
38
  CMD ["./openlist", "server"]