Files
CoRE.Vision/docker-compose.yml
T
git_admin a64749ccc8 storage: multi-storage management with per-storage quota
Replace the single fixed /records path with a list of storages and an
active selection (where new recordings go). Quota is now per-storage.

- config: StorageItem(id,name,type,path,quota_gb,nas-meta) + Storage keeps
  global retention_days/segment_seconds; active + items. Migration from the
  old single {path,quota_gb} schema → one local item.
- recorder: write to the active storage; restart_all() repoints on switch;
  NAS-not-mounted guard (never write into the container overlay).
- indexer: scan ALL storage roots so recordings survive an active switch.
- retention: enforce quota PER storage via db.total_size_under /
  oldest_recordings_under (path-prefix LIKE).
- api/storages: GET/POST/PUT/DELETE + activate + policy. NAS uses host-mount
  (backend stores SMB params, generates the mount/fstab command, reports
  ismount status). Retire old POST /api/storage.
- frontend: new "Хранилища" settings tab — table with inline per-row quota,
  add form (local folder / NAS SMB), global policy (segment + retention).
- compose: add shared ./storages:/storages root for extra local folders and
  host-mounted NAS shares.

VERSION 0.0.127.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 19:31:15 +05:00

46 lines
2.6 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.
services:
nvr-backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: nvr-backend
restart: unless-stopped
# HTTPS обязателен: SharedArrayBuffer (для WASM-декодера H.265) работает
# только в защищённом контексте (https/localhost).
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8090",
"--ssl-keyfile", "/app/certs/key.pem", "--ssl-certfile", "/app/certs/cert.pem"]
ports:
- "443:8090" # дашборд на https://<сервер>
volumes:
- ./certs:/app/certs # self-signed TLS-сертификат (rw: entrypoint генерирует при отсутствии)
- ./VERSION:/app/VERSION:ro # номер версии (показывается в UI)
- ./cameras.yaml:/app/cameras.yaml # rw: редактирование камер из UI
- ./go2rtc.yaml:/app/go2rtc.yaml # rw: бэкенд регенерирует live-потоки
- ./.env.json:/app/.env.json # логин/пароль + ui-настройки (JSON; имя .env.json, чтобы не путать с .env docker compose)
- ./backend/app:/app/app # код бэкенда (правка без пересборки образа)
- ./frontend:/app/frontend # фронтенд (правка без пересборки)
- ./data:/data # SQLite-индекс архива
# Запись. ./records — дефолтное локальное хранилище (id=local).
- ./records:/records
# Общий корень доп. хранилищ (вкладка «Хранилища»): локальные подпапки
# /storages/<id> и точки монтирования NAS. NAS монтируется на ХОСТЕ в
# ./storages/<id>; после `mount` на хосте выполните `docker compose up -d`,
# чтобы том стал виден здесь (или добавьте :rshared для live-подхвата).
- ./storages:/storages
environment:
TZ: Europe/Moscow
NVR_CONFIG: /app/cameras.yaml
NVR_SETTINGS: /app/.env.json
GO2RTC_CONFIG: /app/go2rtc.yaml
NVR_DB: /data/nvr.db
go2rtc:
image: alexxit/go2rtc:latest
container_name: nvr-go2rtc
restart: unless-stopped
network_mode: host # WebRTC проще всего в host-сети (порт 8555 udp/tcp)
volumes:
- ./go2rtc.yaml:/config/go2rtc.yaml:ro
environment:
TZ: Asia/Tashkent