
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本方案提供Flussonic流媒体服务的完整Docker化部署配置,集成了流媒体服务器、数据库(PostgreSQL)、缓存(Redis)及配套管理组件(Central、Watcher系列服务)。通过Docker Compose实现多服务协同部署,支持流媒体的接收、转码、分发、录像及集群管理,适用于快速搭建企业级流媒体服务环境。
1. 环境准备
需预先准备以下环境变量:
LICENSE_KEY: Flussonic服务授权密钥DOMAIN: 部署服务的域名或IP地址CLUSTER_KEY: 集群认证密钥CENTRAL_API_KEY: Central组件API访问密钥2. 创建Docker Compose配置文件
创建docker-compose.yml文件,内容如下:
yamlversion: "3.7" volumes: dvr_storage: driver: local services: db: image: flussonic/postgres:16 restart: always environment: POSTGRES_USER: watcher POSTGRES_PASSWORD: watcher POSTGRES_DB: watcher ports: - "5432:5432" expose: - 5432 healthcheck: test: "pg_isready -q -d ${POSTGRES_DB} -U ${POSTGRES_USER}" interval: 10s timeout: 20s retries: 3 start_period: 5s redis: image: flussonic/redis:7 restart: always ports: - "6379:6379" expose: - 6379 flussonic: image: flussonic/flussonic:latest container_name: flussonic restart: always environment: LICENSE_KEY: ${LICENSE_KEY} STREAMER_CLUSTER_KEY: ${CLUSTER_KEY} STREAMER_HTTP: 80 ports: - "80:80" - "1935:1935" - "554:554" - "443:443" volumes: - "/etc/localtime:/etc/localtime:ro" - dvr_storage:/storage central-migrate: image: flussonic/central:latest depends_on: db: condition: service_healthy environment: CENTRAL_DATABASE_URL: postgres://watcher:watcher@db.:5432/watcher?sslmode=disable&search_path=central command: ['bin/central', '--migrate'] central: image: flussonic/central:latest restart: always depends_on: db: condition: service_healthy central-migrate: condition: service_completed_successfully environment: CENTRAL_DATABASE_URL: postgres://watcher:watcher@db.:5432/watcher?sslmode=disable&search_path=central CENTRAL_HTTP_PORT: 9019 CENTRAL_API_KEY: ${CENTRAL_API_KEY} CENTRAL_API_URL: http://${DOMAIN}:9019 CENTRAL_UPSTREAM_URL: http://${CLUSTER_KEY}@flussonic:80 CENTRAL_REDIS_URL: redis://redis:6379/2 ports: - "9019:9019" expose: - 9019 watcher-migrate: image: flussonic/watcher:latest depends_on: db: condition: service_healthy environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: http://${CLUSTER_KEY}@flussonic:80 API_URL: http://${DOMAIN} WATCHER_ADMIN_LOGIN: admin WATCHER_ADMIN_PASSWORD: admin entrypoint: [""] command: > bash -c "/opt/flussonic/contrib/watcher db upgrade && /opt/flussonic/contrib/watcher create_local_streamer && /opt/flussonic/contrib/watcher firstrun && /opt/flussonic/bin/watcher-sync.sh" watcher-vms: image: flussonic/watcher:latest container_name: watcher restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: http://${CLUSTER_KEY}@flussonic:80 API_URL: http://${DOMAIN} LISTEN_HOST: 0.0.0.0 PORT: 9025 entrypoint: [""] command: ['/opt/flussonic/bin/watcher.sh', 'run'] ports: - "9025:9025" watcher-episodes: image: flussonic/watcher:latest restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: http://${CLUSTER_KEY}@flussonic:80 entrypoint: [""] command: ['/opt/flussonic/bin/watcher.sh', 'episodes'] watcher-scheduler: image: flussonic/watcher:latest restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 entrypoint: [""] command: ['/opt/flussonic/bin/watcher.sh', 'scheduler'] watcher-worker-default: image: flussonic/watcher:latest restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 entrypoint: [""] command: ['/opt/flussonic/bin/watcher.sh', 'worker'] watcher-worker-high: image: flussonic/watcher:latest restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 entrypoint: [""] command: ['/opt/flussonic/bin/watcher.sh', 'worker', 'high'] watcher-go: image: flussonic/watcher:latest restart: always depends_on: db: condition: service_healthy watcher-migrate: condition: service_completed_successfully redis: condition: service_started central: condition: service_started environment: LICENSE_KEY: ${LICENSE_KEY} DATABASE_URL: postgresql://watcher:watcher@db/watcher REDIS: redis://redis:6379 CENTRAL_URL: http://${CENTRAL_API_KEY}@central:9019/streamer/api/v3 API_URL: http://${DOMAIN} entrypoint: [""] command: ['/opt/flussonic/bin/watcher-go.sh']
3. 部署步骤
准备环境变量:替换以下变量值
LICENSE_KEY: 从Flussonic获取的授权密钥DOMAIN: 部署服务的域名或服务器IPCLUSTER_KEY: 集群认证密钥CENTRAL_API_KEY: Central服务API访问密钥启动服务:执行以下命令启动所有服务
bashDOMAIN=<你的域名> CLUSTER_KEY=<集群密钥> CENTRAL_API_KEY=<中央API密钥> LICENSE_KEY=<授权密钥> docker compose -f docker-compose.yml up -d
4. 服务更新
如需更新镜像版本,执行以下命令:
bash# 拉取最新镜像 docker compose -f docker-compose.yml pull # 重启服务应用更新 DOMAIN=<你的域名> CLUSTER_KEY=<集群密钥> CENTRAL_API_KEY=<中央API密钥> LICENSE_KEY=<授权密钥> docker compose -f docker-compose.yml up -d
dvr_storage卷持久化存储录像数据所有服务通过环境变量注入配置,支持灵活定制部署参数,确保服务间协同工作。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。






来自真实用户的反馈,见证轩辕镜像的优质服务