dragg2 commited on
Commit
919170c
·
verified ·
1 Parent(s): d2e0457

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -3
Dockerfile CHANGED
@@ -1,9 +1,29 @@
1
  FROM yimik/kkfileview:latest
2
 
 
 
 
 
 
 
 
 
 
 
3
  ENV SERVER_PORT=7860
4
- ENV KK_SERVER_PORT=7860
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  EXPOSE 7860
7
 
8
- USER root
9
- RUN chmod -R 777 /opt/kkFileView* || echo "Directory not found, skipping chmod"
 
1
  FROM yimik/kkfileview:latest
2
 
3
+ # 安装 Xvfb 和其他必要依赖
4
+ USER root
5
+ RUN apt-get update && apt-get install -y \
6
+ xvfb \
7
+ libxrender1 \
8
+ libxext6 \
9
+ libxi6 \
10
+ libgconf-2-4 \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
  ENV SERVER_PORT=7860
14
+
15
+ RUN echo '#!/bin/bash\n\
16
+ # 启动虚拟显示\n\
17
+ Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &\n\
18
+ export DISPLAY=:99\n\
19
+ # 等待 Xvfb 启动\n\
20
+ sleep 2\n\
21
+ # 启动 kkFileView\n\
22
+ cd /opt/kkFileView-4.1.0 && bin/startup.sh\n\
23
+ # 保持容器运行\n\
24
+ tail -f /opt/kkFileView-4.1.0/log/kkFileView.log\n\
25
+ ' > /start.sh && chmod +x /start.sh
26
 
27
  EXPOSE 7860
28
 
29
+ CMD ["/start.sh"]