xhs_factory/docker-compose.yml
zhoujie 2ba87c8f6e
Some checks failed
CI / Lint (ruff) (push) Has been cancelled
CI / Import Check (push) Has been cancelled
📝 docs(project): 添加开源社区标准文档与 CI 工作流
- 新增 GitHub Issue 模板(Bug 报告、功能请求)和 Pull Request 模板
- 新增 Code of Conduct(贡献者行为准则)和 Security Policy(安全政策)
- 新增 CI 工作流(GitHub Actions),包含 ruff 代码检查和导入验证
- 新增开发依赖文件 requirements-dev.txt

📦 build(ci): 配置 GitHub Actions 持续集成

- 在 push 到 main 分支和 pull request 时自动触发 CI
- 添加 lint 任务执行 ruff 代码风格检查
- 添加 import-check 任务验证核心服务模块导入

♻️ refactor(structure): 重构项目目录结构

- 将根目录的 6 个服务模块迁移至 services/ 包
- 更新所有相关文件的导入语句(main.py、ui/、services/)
- 根目录仅保留 main.py 作为唯一 Python 入口文件

🔧 chore(config): 调整配置和资源文件路径

- 将 config.json 移至 config/ 目录,更新相关引用
- 将个人头像图片移至 assets/faces/ 目录,更新 .gitignore
- 更新 Dockerfile 和 docker-compose.yml 中的配置路径

📝 docs(readme): 完善 README 文档

- 添加项目状态徽章(Python 版本、License、CI)
- 更新项目结构图反映实际目录布局
- 修正使用指南中的 Tab 名称和操作路径
- 替换 your-username 占位符为格式提示

🗑️ chore(cleanup): 清理冗余文件

- 删除旧版备份文件、测试脚本、临时记录和运行日志
- 删除散落的个人图片文件(已归档至 assets/faces/)
2026-02-27 22:12:39 +08:00

81 lines
2.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: "3.8"
services:
# ============================================================
# 小红书 AI 爆文工坊(主应用)
# ============================================================
xhs-autobot:
build: .
container_name: xhs-autobot
restart: unless-stopped
ports:
- "7860:7860"
volumes:
# 配置文件挂载(首次请从 config/config.example.json 复制并填写)
- ./config/config.json:/app/config/config.json
# 工作目录(导出的文案 & 图片)
- ./xhs_workspace:/app/xhs_workspace
environment:
- GRADIO_SERVER_NAME=0.0.0.0
- GRADIO_SERVER_PORT=7860
depends_on:
xhs-mcp:
condition: service_started
networks:
- xhs-net
# ============================================================
# xiaohongshu-mcp 服务(小红书 API 代理)
# ============================================================
xhs-mcp:
image: node:20-slim
container_name: xhs-mcp
restart: unless-stopped
ports:
- "18060:18060"
working_dir: /app
# 首次启动自动安装并运行 xiaohongshu-mcp
command: >
sh -c "
npm install -g xiaohongshu-mcp &&
npx xiaohongshu-mcp --port 18060 --host 0.0.0.0
"
volumes:
# cookies 持久化(登录后保留会话)
- xhs-mcp-data:/root/.xiaohongshu-mcp
networks:
- xhs-net
# ============================================================
# Stable Diffusion WebUI可选 — 取消注释启用)
# ⚠ 需要 NVIDIA GPU + nvidia-docker
# ============================================================
# sd-webui:
# image: ghcr.io/AUTOMATIC1111/stable-diffusion-webui:latest
# container_name: sd-webui
# restart: unless-stopped
# ports:
# - "7861:7860"
# volumes:
# - sd-models:/app/models
# - sd-outputs:/app/outputs
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
# command: ["python", "launch.py", "--api", "--listen"]
# networks:
# - xhs-net
volumes:
xhs-mcp-data:
# sd-models:
# sd-outputs:
networks:
xhs-net:
driver: bridge