
本方案提供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卷持久化存储录像数据所有服务通过环境变量注入配置,支持灵活定制部署参数,确保服务间协同工作。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。





探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务