LogLInk1K commited on
Commit
4ce85ef
·
verified ·
1 Parent(s): ad41396

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -3,14 +3,17 @@ WORKDIR /opt/openlist
3
  USER root
4
  EXPOSE 5244
5
 
6
-
7
  CMD sh -c "\
8
- mkdir -p /opt/openlist/data && \
9
- if [ -z \"\$DB_BASE64\" ]; then \
10
- echo 'Empty DB_BASE64'; \
11
- else \
12
- echo \"\$DB_BASE64\" | base64 -d > /opt/openlist/data/data.db; \
13
- fi && \
14
- echo '--- 检测原生能力 ---' && \
15
- ./openlist storage create --help 2>&1 | head -n 5; \
16
- ./openlist server"
 
 
 
 
 
3
  USER root
4
  EXPOSE 5244
5
 
 
6
  CMD sh -c "\
7
+ ./openlist server & \
8
+ PID=\$!; \
9
+ sleep 6; \
10
+ \
11
+ if [ -n \"\$STORAGE_JSON\" ]; then \
12
+ echo '🚀 正在使用 API 添加网盘...'; \
13
+ wget --post-data=\"\$STORAGE_JSON\" \
14
+ --header=\"Content-Type: application/json\" \
15
+ --header=\"Authorization: \$ADMIN_TOKEN\" \
16
+ -O - http://127.0.0.1:5244/api/admin/storage/update || echo '❌ 注入失败'; \
17
+ fi; \
18
+ \
19
+ wait \$PID"