Files
appRobotWebcam/docker-compose.yaml
2026-06-02 23:15:13 +02:00

56 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: approbotwebcam
# ── Portainer Web-Editor: dieses YAML einfügen, dann Deploy ─────────────────
#
# Voraussetzungen:
# 1. Code auf dem Server (git clone / Synology Drive sync)
# 2. go2rtc.yaml muss im selben Verzeichnis liegen wie dieses File
# 3. 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)
#
# network_mode: host → beide Container teilen den Host-Netzwerk-Stack.
# Das ist für WebRTC entscheidend: go2rtc bekommt die echte Host-IP als
# ICE-Kandidat, nicht eine Docker-interne 172.x-Adresse.
# ─────────────────────────────────────────────────────────────────────────────
services:
# ── go2rtc: Kamera-Capture + H.264-Encoding + WebRTC ──────────────────────
go2rtc:
image: ghcr.io/alexxit/go2rtc
container_name: AppRobotGo2RTC
restart: unless-stopped
network_mode: host
devices:
- /dev/video0:/dev/video0
- /dev/video2:/dev/video2
group_add:
- video
volumes:
# go2rtc.yaml liegt im selben Verzeichnis wie docker-compose.yaml
- ${APP_PATH:-.}/go2rtc.yaml:/config/go2rtc.yaml:ro
# ── 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
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