本方案提供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卷持久化存储录像数据所有服务通过环境变量注入配置,支持灵活定制部署参数,确保服务间协同工作。
来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429