- core/webrtc: NewSourceOn(streamID, host, port) allows binding the RTP UDP socket on something other than 127.0.0.1, required when the PoC runs in a container and must accept RTP from LAN publishers. NewSource(streamID, port) stays as a convenience wrapper on 127.0.0.1 for existing tests and tight local tests. - cmd/webrtc-poc: new -rtp-host flag (default 127.0.0.1 for safety). - deploy/docker/Dockerfile: two-stage build, scratch runtime, ~14 MB. - deploy/truenas/docker-compose.yml: host-networked stack template driven by a .env file. Host networking is required for WebRTC ICE to work without NAT rewriting per-candidate. - deploy/truenas/README.md: operator runbook with port picking, bring-up, verification curls, and security notes.
36 lines
1.4 KiB
YAML
36 lines
1.4 KiB
YAML
# Dragon Fork WebRTC PoC — TrueNAS deployment template.
|
|
#
|
|
# Host networking is required: WebRTC ICE needs each container-visible
|
|
# UDP socket to be reachable from the peer using the LAN (or public)
|
|
# IP advertised in SDP. Bridge + port mapping breaks ICE because
|
|
# remote candidates encode the peer-visible host:port.
|
|
#
|
|
# Copy this file to /mnt/NVME/Docker/dragonfork-webrtc-poc/
|
|
# alongside a .env like:
|
|
#
|
|
# WHEP_PORT=45121 # TCP, the WHEP HTTP listener
|
|
# RTP_PORT=49248 # UDP, publisher's RTP ingest port
|
|
# STREAM_ID=test
|
|
# PUBLIC_IP=10.0.0.25 # LAN IP; rewrites ICE host candidates via NAT1To1.
|
|
# Set to your public IP when exposing externally.
|
|
#
|
|
# Then:
|
|
# docker compose up -d --build
|
|
|
|
services:
|
|
webrtc-poc:
|
|
build:
|
|
context: ../.. # repo root (where go.mod lives)
|
|
dockerfile: deploy/docker/Dockerfile
|
|
container_name: dragonfork-webrtc-poc
|
|
restart: unless-stopped
|
|
network_mode: host
|
|
command:
|
|
- -stream=${STREAM_ID:-test}
|
|
- -rtp-host=${RTP_HOST:-0.0.0.0}
|
|
- -rtp-port=${RTP_PORT:?set RTP_PORT}
|
|
- -listen=:${WHEP_PORT:?set WHEP_PORT}
|
|
- -public-ip=${PUBLIC_IP:-}
|
|
# No ports: host networking exposes whatever the process binds.
|
|
# No healthcheck: scratch image has no shell. Compose uses exit
|
|
# code only; the binary exits non-zero if it can't bind.
|