
flussonic/watcher本方案提供Flussonic流媒体服务的完整Docker化部署配置,集成了流媒体服务器、数据库(PostgreSQL)、缓存(Redis)及配套管理组件(Central、Watcher系列服务)。通过Docker Compose实现多服务协同部署,支持流媒体的接收、转码、分发、录像及集群管理,适用于快速搭建企业级流媒体服务环境。
需预先准备以下环境变量:
LICENSE_KEY: Flussonic服务授权密钥DOMAIN: 部署服务的域名或IP地址CLUSTER_KEY: 集群认证密钥CENTRAL_API_KEY: Central组件API访问密钥创建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: [***]{DOMAIN}:9019 CENTRAL_UPSTREAM_URL: [***]{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: [***]{CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: [***]{CLUSTER_KEY}@flussonic:80 API_URL: [***]{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: [***]{CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: [***]{CLUSTER_KEY}@flussonic:80 API_URL: [***]{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: [***]{CENTRAL_API_KEY}@central:9019/streamer/api/v3 FLUSSONIC_MASTER: [***]{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: [***]{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: [***]{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: [***]{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: [***]{CENTRAL_API_KEY}@central:9019/streamer/api/v3 API_URL: [***]{DOMAIN} entrypoint: [""] command: ['/opt/flussonic/bin/watcher-go.sh']
准备环境变量:替换以下变量值
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
如需更新镜像版本,执行以下命令:
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卷持久化存储录像数据所有服务通过环境变量注入配置,支持灵活定制部署参数,确保服务间协同工作。





manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务