dragg2 commited on
Commit
e8539ed
·
verified ·
1 Parent(s): f3b0cae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -18
Dockerfile CHANGED
@@ -11,10 +11,6 @@ RUN apt-get update && apt-get install -y \
11
  libfreetype6 \
12
  fontconfig \
13
  fonts-wqy-zenhei \
14
- libreoffice \
15
- libreoffice-writer \
16
- libreoffice-calc \
17
- libreoffice-impress \
18
  && rm -rf /var/lib/apt/lists/* \
19
  && fc-cache -fv
20
 
@@ -118,17 +114,9 @@ export DISPLAY=:99\n\
118
  sleep 2\n\
119
  echo "✓ Xvfb started on DISPLAY=:99"\n\
120
  \n\
121
- # 启动 LibreOffice 进程池\n\
122
- echo "Starting LibreOffice process pool..."\n\
123
- for port in 2001 2002 2003 2004 2005; do\n\
124
- soffice --headless --accept="socket,host=127.0.0.1,port=$port;urp;" --nofirststartwizard >/dev/null 2>&1 &\n\
125
- echo " - LibreOffice process started on port $port"\n\
126
- done\n\
127
- sleep 3\n\
128
- echo "✓ LibreOffice process pool ready"\n\
129
- \n\
130
- # 启动 KKFileView\n\
131
  echo "Starting KKFileView on port 8012..."\n\
 
132
  export JAVA_OPTS="$JAVA_OPTS"\n\
133
  \n\
134
  if [[ "$STARTUP_SCRIPT" == *".sh" ]]; then\n\
@@ -164,10 +152,14 @@ for i in {1..60}; do\n\
164
  sleep 2\n\
165
  done\n\
166
  \n\
167
- # 验证 LibreOffice 进程池\n\
168
- echo "Verifying LibreOffice process pool..."\n\
169
  LIBREOFFICE_COUNT=$(ps aux | grep soffice | grep -v grep | wc -l)\n\
170
- echo " - LibreOffice processes running: $LIBREOFFICE_COUNT"\n\
 
 
 
 
171
  \n\
172
  # 启动 Nginx\n\
173
  echo "Starting Nginx on port 7860..."\n\
@@ -183,4 +175,4 @@ EXPOSE 7860
183
 
184
  # 9. 启动命令
185
  ENTRYPOINT []
186
- CMD ["/start.sh"]
 
11
  libfreetype6 \
12
  fontconfig \
13
  fonts-wqy-zenhei \
 
 
 
 
14
  && rm -rf /var/lib/apt/lists/* \
15
  && fc-cache -fv
16
 
 
114
  sleep 2\n\
115
  echo "✓ Xvfb started on DISPLAY=:99"\n\
116
  \n\
117
+ # 启动 KKFileView)\n\
 
 
 
 
 
 
 
 
 
118
  echo "Starting KKFileView on port 8012..."\n\
119
+ echo "LibreOffice will be managed by KKFileView automatically"\n\
120
  export JAVA_OPTS="$JAVA_OPTS"\n\
121
  \n\
122
  if [[ "$STARTUP_SCRIPT" == *".sh" ]]; then\n\
 
152
  sleep 2\n\
153
  done\n\
154
  \n\
155
+ # 验证 LibreOffice\n\
156
+ echo "Checking LibreOffice status..."\n\
157
  LIBREOFFICE_COUNT=$(ps aux | grep soffice | grep -v grep | wc -l)\n\
158
+ if [ $LIBREOFFICE_COUNT -gt 0 ]; then\n\
159
+ echo "✓ LibreOffice processes running: $LIBREOFFICE_COUNT"\n\
160
+ else\n\
161
+ echo "⚠ LibreOffice not detected (will be started on first use)"\n\
162
+ fi\n\
163
  \n\
164
  # 启动 Nginx\n\
165
  echo "Starting Nginx on port 7860..."\n\
 
175
 
176
  # 9. 启动命令
177
  ENTRYPOINT []
178
+ CMD ["/start.sh"]