leowuming commited on
Commit
7126dfc
·
verified ·
1 Parent(s): 05d00d1

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. 使用 anthingllm:latest 官方镜像作为基础
2
+ FROM mintplexlabs/anythingllm:latest
3
+
4
+ # 2. 切换到 root 用户以安装软件包
5
+ USER root
6
+
7
+ # 3. 安装持久化方案所需的全部工具
8
+ # git: 用于 GitHub 备份
9
+ # rclone: 用于 WebDAV 高效同步
10
+ # util-linux: 提供 flock 文件锁工具
11
+ # sqlite3: 用于安全的数据库在线备份
12
+ # rsync: 用于高效、安全地在目录间同步文件
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ git \
15
+ rclone \
16
+ util-linux \
17
+ sqlite3 \
18
+ rsync \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # 4. 创建脚本目录
22
+ RUN mkdir -p /app/scripts
23
+
24
+ # 5. 复制所有脚本和配置文件到容器内
25
+ COPY scripts/ /app/scripts/
26
+ COPY entrypoint.sh /app/entrypoint.sh
27
+
28
+ # 6. 赋予所有脚本执行权限
29
+ RUN chmod +x /app/entrypoint.sh /app/scripts/*.sh
30
+
31
+ # 7. 切换回官方镜像指定的非 root 用户
32
+ USER anythingllm
33
+
34
+ # 8. 设置工作目录
35
+ WORKDIR /app/server
36
+
37
+ # 9. 定义容器的入口点
38
+ ENTRYPOINT ["/app/entrypoint.sh"]