Files
appRobotWebcam/docker-compose.yaml

67 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 direkt einfügen ───────────────────────
# Voraussetzungen auf dem Server:
# 1. docker network create appRobotNet
# 2. Code-Verzeichnis liegt auf dem Server (git clone / rsync / Synology Drive)
# 3. In Portainer unter "Environment variables" setzen:
# APP_PATH=/absoluter/pfad/zum/appRobotWebcam
#
# Beim ersten Deploy baut Portainer das Image (Node.js + FFmpeg).
# Danach reicht "Redeploy" kein Rebuild nötig ausser bei System-Updates.
# ─────────────────────────────────────────────────────────────────────────────
services:
webcam:
build:
context: /tmp # Leerer Build-Context: kein COPY nötig, Code kommt per Bind-Mount
dockerfile_inline: |
FROM node:lts-bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg \
v4l-utils \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
EXPOSE 8080
image: approbotwebcam:latest
container_name: AppRobotWebcam
restart: unless-stopped
# npm install läuft einmalig beim Start, danach gecacht in node_modules
command: sh -c "npm install && node server.js"
volumes:
# APP_PATH in Portainer setzen, z.B. /volume1/docker/appRobotWebcam
# Lokal (ohne Portainer): APP_PATH nicht setzen → Fallback auf ./
- ${APP_PATH:-.}:/usr/src/app
ports:
- "8444:8080"
environment:
- NODE_ENV=production
- PORT=8080
- DEV0=/dev/video0
- DEV1=/dev/video2
# Optional Defaults: 640x480 @ 30fps, Qualität 5
# - CAM0_WIDTH=640
# - CAM0_HEIGHT=480
# - CAM0_FPS=30
# - CAM0_QUALITY=5
devices:
- /dev/video0:/dev/video0
- /dev/video2:/dev/video2
# Kamera-Zugriffsrechte: Node-Prozess braucht Gruppe 'video'
group_add:
- video
networks:
- appRobotNet
networks:
appRobotNet:
external: true