aappeekk commited on
Commit
f7564fc
·
verified ·
1 Parent(s): d558b55

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -5
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM node:18-slim
2
 
 
3
  RUN apt-get update && apt-get install -y \
4
  wget \
5
  gnupg \
@@ -11,23 +12,31 @@ RUN apt-get update && apt-get install -y \
11
  fonts-noto-cjk \
12
  python3 \
13
  python3-pip \
14
- curl \
15
  lsof \
16
  && apt-get clean
17
 
 
18
  RUN git clone https://github.com/xhzngm/boilerplate.git /app
19
  WORKDIR /app
20
 
 
21
  RUN corepack enable && yarn install
22
- RUN chmod -R 775 /app
23
 
24
- RUN pip3 install --break-system-packages requests webdavclient3
 
 
25
 
 
 
 
 
26
  ENV CHROME_PATH=/usr/bin/chromium
 
27
  EXPOSE 5140
28
 
 
29
  COPY sync_data.sh /sync_data.sh
30
  RUN chmod +x /sync_data.sh
31
 
32
- # ⚠️ 不直接 yarn start
33
- CMD ["/bin/bash", "/sync_data.sh"]
 
1
  FROM node:18-slim
2
 
3
+ # 安装工具、Chrome 依赖以及 WebDAV 脚本需要的 lsof
4
  RUN apt-get update && apt-get install -y \
5
  wget \
6
  gnupg \
 
12
  fonts-noto-cjk \
13
  python3 \
14
  python3-pip \
 
15
  lsof \
16
  && apt-get clean
17
 
18
+ # 克隆 Koishi 仓库
19
  RUN git clone https://github.com/xhzngm/boilerplate.git /app
20
  WORKDIR /app
21
 
22
+ # 安装 Koishi 依赖
23
  RUN corepack enable && yarn install
 
24
 
25
+ # 安装 Python WebDAV 客户端
26
+ # 注意:这里直接安装到系统环境(--break-system-packages),对应脚本中的 python3 路径
27
+ RUN pip3 install --break-system-packages webdavclient3 requests
28
 
29
+ # 修改权限
30
+ RUN chmod -R 777 /app
31
+
32
+ # 设置环境变量
33
  ENV CHROME_PATH=/usr/bin/chromium
34
+ # 这里的端口必须与 readme.MD 中的 app_port 保持一致
35
  EXPOSE 5140
36
 
37
+ # 添加并授权同步脚本
38
  COPY sync_data.sh /sync_data.sh
39
  RUN chmod +x /sync_data.sh
40
 
41
+ # 启动命令
42
+ CMD ["bash", "/sync_data.sh"]