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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -12
Dockerfile CHANGED
@@ -1,28 +1,49 @@
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
 
 
1
  FROM yimik/kkfileview:latest
2
 
 
3
  USER root
4
+
5
  RUN apt-get update && apt-get install -y \
6
  xvfb \
7
  libxrender1 \
8
  libxext6 \
9
  libxi6 \
10
  libgconf-2-4 \
11
+ fonts-wqy-microhei \
12
+ fonts-wqy-zenhei \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  ENV SERVER_PORT=7860
16
 
17
+ # 信任所有主机
18
+ RUN sed -i 's/trust.host=.*/trust.host=default/g' \
19
+ /opt/kkFileView-4.1.0/config/application.properties || \
20
+ echo "trust.host=default" >> /opt/kkFileView-4.1.0/config/application.properties
21
+
22
+ RUN cat > /start.sh << 'EOF'
23
+ #!/bin/bash
24
+ set -e
25
+
26
+ echo "=== Starting kkFileView on Hugging Face Spaces ==="
27
+
28
+ echo "Trust host configuration:"
29
+ grep trust.host /opt/kkFileView-4.1.0/config/application.properties || echo "Not found"
30
+
31
+ # 启动虚拟显示
32
+ echo "Starting Xvfb..."
33
+ Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &
34
+ export DISPLAY=:99
35
+ sleep 3
36
+
37
+ # 启动 kkFileView
38
+ echo "Starting kkFileView..."
39
+ cd /opt/kkFileView-4.1.0
40
+ bin/startup.sh
41
+
42
+ # 保持运行并显示日志
43
+ tail -f log/kkFileView.log
44
+ EOF
45
+
46
+ RUN chmod +x /start.sh
47
 
48
  EXPOSE 7860
49