Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files1233456789101112131415161516171819202122232425171819202122232425262728293031323334353637383940414243444546474849FROM yimik/kkfileview:latest
# 安装 Xvfb 和其他必要依赖USER root
RUN apt-get update && apt-get install -y \ xvfb \ libxrender1 \ libxext6 \ libxi6 \ libgconf-2-4 \ fonts-wqy-microhei \ fonts-wqy-zenhei \ && rm -rf /var/lib/apt/lists/*
ENV SERVER_PORT=7860
RUN echo '#!/bin/bash\n\# 启动虚拟显示\n\Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &\n\export DISPLAY=:99\n\# 等待 Xvfb 启动\n\sleep 2\n\# 启动 kkFileView\n\cd /opt/kkFileView-4.1.0 && bin/startup.sh\n\# 保持容器运行\n\tail -f /opt/kkFileView-4.1.0/log/kkFileView.log\n\' > /start.sh && chmod +x /start.sh# 信任所有主机RUN sed -i 's/trust.host=.*/trust.host=default/g' \ /opt/kkFileView-4.1.0/config/application.properties || \ echo "trust.host=default" >> /opt/kkFileView-4.1.0/config/application.properties
RUN cat > /start.sh << 'EOF'#!/bin/bashset -e
echo "=== Starting kkFileView on Hugging Face Spaces ==="
echo "Trust host configuration:"grep trust.host /opt/kkFileView-4.1.0/config/application.properties || echo "Not found"
# 启动虚拟显示echo "Starting Xvfb..."Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &export DISPLAY=:99sleep 3
# 启动 kkFileViewecho "Starting kkFileView..."cd /opt/kkFileView-4.1.0bin/startup.sh
# 保持运行并显示日志tail -f log/kkFileView.logEOF
RUN chmod +x /start.sh
EXPOSE 7860
Dockerfile+33-12