82 lines
2.9 KiB
YAML
82 lines
2.9 KiB
YAML
name: approbotwebcam
|
||
|
||
# ── Portainer Web-Editor: dieses YAML einfügen, dann Deploy ─────────────────
|
||
#
|
||
# Voraussetzungen:
|
||
# 1. Code auf dem Server (git clone / Synology Drive sync)
|
||
# 2. In Portainer → "Environment variables":
|
||
# APP_PATH = /absoluter/pfad/zum/appRobotWebcam
|
||
#
|
||
# Firewall: genau zwei Ports freigeben:
|
||
# TCP 8444 → HTTP (Viewer · Snapshot-API · WebRTC-Signaling)
|
||
# UDP 8555 → WebRTC Media (go2rtc direkt, kann nicht proxiert werden)
|
||
#
|
||
# go2rtc-Konfiguration steht unten im "configs"-Block.
|
||
# Kameras, Codec oder Ports ändern? → configs.go2rtc_config.content anpassen.
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
|
||
# ── go2rtc-Konfiguration (eingebettet, kein separates File nötig) ─────────────
|
||
configs:
|
||
go2rtc_config:
|
||
content: |
|
||
streams:
|
||
cam0:
|
||
- "ffmpeg:/dev/video0#video=h264"
|
||
cam1:
|
||
- "ffmpeg:/dev/video2#video=h264"
|
||
|
||
webrtc:
|
||
ice_servers:
|
||
- urls:
|
||
- stun:stun.l.google.com:19302
|
||
- stun:stun1.l.google.com:19302
|
||
# Fixer UDP-Port → eine Firewall-Regel reicht
|
||
listen: ":8555/udp"
|
||
|
||
api:
|
||
listen: ":1984"
|
||
origin: "*"
|
||
|
||
log:
|
||
level: warn
|
||
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
services:
|
||
|
||
# ── go2rtc: Kamera-Capture + H.264-Encoding + WebRTC ──────────────────────
|
||
go2rtc:
|
||
image: ghcr.io/alexxit/go2rtc
|
||
container_name: AppRobotGo2RTC
|
||
restart: unless-stopped
|
||
# host-Netzwerk: go2rtc bekommt die echte Host-IP als ICE-Kandidat
|
||
# → WebRTC funktioniert auf LAN und über die Firewall
|
||
network_mode: host
|
||
devices:
|
||
- /dev/video0:/dev/video0
|
||
- /dev/video2:/dev/video2
|
||
group_add:
|
||
- video
|
||
configs:
|
||
- source: go2rtc_config
|
||
target: /config/go2rtc.yaml
|
||
|
||
# ── webcam: Node.js (Viewer · Snapshot-Proxy · WebRTC-Signaling-Proxy) ───
|
||
webcam:
|
||
build:
|
||
context: /tmp # Leerer Build-Context – Code kommt per Bind-Mount
|
||
dockerfile_inline: |
|
||
FROM node:lts-bookworm-slim
|
||
WORKDIR /usr/src/app
|
||
EXPOSE 8444
|
||
image: approbotwebcam:latest
|
||
container_name: AppRobotWebcam
|
||
restart: unless-stopped
|
||
network_mode: host # Erreicht go2rtc über localhost:1984
|
||
command: sh -c "npm install && node server.js"
|
||
volumes:
|
||
- ${APP_PATH:-.}:/usr/src/app
|
||
environment:
|
||
- NODE_ENV=production
|
||
- PORT=8444
|
||
- GO2RTC_URL=http://localhost:1984
|