Spaces:
Running
Running
| FROM yimik/kkfileview:latest | |
| 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 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 printf '#!/bin/bash\n\ | |
| echo "=== Starting kkFileView on Hugging Face Spaces ==="\n\ | |
| echo "Trust host configuration:"\n\ | |
| grep trust.host /opt/kkFileView-4.1.0/config/application.properties || echo "Not found"\n\ | |
| echo "Starting Xvfb..."\n\ | |
| Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &\n\ | |
| export DISPLAY=:99\n\ | |
| sleep 3\n\ | |
| echo "Starting kkFileView..."\n\ | |
| cd /opt/kkFileView-4.1.0\n\ | |
| bin/startup.sh\n\ | |
| tail -f log/kkFileView.log\n' > /start.sh && \ | |
| chmod +x /start.sh | |
| EXPOSE 7860 | |
| CMD ["/start.sh"] | |