# Hugging Face Spaces Dockerfile for Octopus # 基于官方镜像 bestrui/octopus FROM bestrui/octopus:latest # 设置环境变量适配 Hugging Face Spaces # 注意: 必须设置 OCTOPUS_SERVER_PORT=7860,这是 Hugging Face Spaces 的要求 ENV OCTOPUS_SERVER_HOST=0.0.0.0 \ OCTOPUS_SERVER_PORT=7860 \ OCTOPUS_LOG_LEVEL=info \ TZ=Asia/Shanghai # 确保 data 目录存在 (Hugging Face Spaces 会自动持久化 /app/data) RUN mkdir -p /app/data # 暴露端口 (Hugging Face Spaces 使用 7860) EXPOSE 7860 # 健康检查 HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:7860/ || exit 1 # 启动命令 # 原镜像已包含 /entrypoint.sh 脚本,该脚本会执行 ./octopus start # 也可以直接使用: CMD ["/app/octopus", "start"] CMD ["/entrypoint.sh"]