This commit is contained in:
2026-03-23 09:58:40 -03:00
parent 9c9c7dff09
commit 8186bb5fe6
40 changed files with 3996 additions and 17 deletions

View File

@@ -190,6 +190,20 @@ services:
- ../ui/chunker/vite.config.ts:/app/vite.config.ts
- ../ui/common:/common
detection:
build:
context: ../ui/detection-app
dockerfile: Dockerfile
ports:
- "5175:5175"
environment:
VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-}
volumes:
- ../ui/detection-app/src:/app/src
- ../ui/detection-app/vite.config.ts:/app/vite.config.ts
- ../ui/detection-app/index.html:/app/index.html
- ../ui/framework:/app/node_modules/mpr-ui-framework
volumes:
postgres-data:
redis-data:

View File

@@ -97,6 +97,11 @@
<div class="card-title">Chunker</div>
<div class="card-desc">Split media into segments, pipeline visualization</div>
</a>
<a class="card" href="/detection/">
<div class="card-icon">&#9678;</div>
<div class="card-title">Detection</div>
<div class="card-desc">Media brand detection, realtime observability</div>
</a>
</div>
<div class="links">
<a href="/admin/">Admin</a>

View File

@@ -29,6 +29,10 @@ http {
server minio:9000;
}
upstream detection {
server detection:5175;
}
upstream envoy {
server envoy:8090;
}
@@ -76,6 +80,35 @@ http {
proxy_set_header Connection "upgrade";
}
# Detection UI
location /detection/ {
proxy_pass http://detection;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# Vite HMR websocket (detection)
location /detection/@vite {
proxy_pass http://detection;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# SSE streams — disable buffering for realtime delivery
location /api/detect/stream/ {
proxy_pass http://fastapi/detect/stream/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
chunked_transfer_encoding on;
}
# Chunker UI
location /chunker/ {
proxy_pass http://chunker;

View File

@@ -3,14 +3,15 @@
# Usage: ./run.sh [OPTIONS] [docker-compose args]
#
# Options:
# -f, --foreground Run in foreground (don't detach)
# -d, --detach Run detached (background)
# --build Rebuild images before starting
# stop Stop all services
#
# Examples:
# ./run.sh # Start detached
# ./run.sh -f # Start in foreground (see logs)
# ./run.sh # Start attached (see logs)
# ./run.sh -d # Start detached
# ./run.sh --build # Rebuild and start
# ./run.sh logs -f # Follow logs
# ./run.sh stop # Stop all services
set -e
@@ -35,19 +36,23 @@ if ! grep -q "mpr.local.ar" /etc/hosts 2>/dev/null; then
fi
# Parse options
DETACH="-d"
DETACH=""
BUILD=""
while [[ $# -gt 0 ]]; do
case $1 in
-f|--foreground)
DETACH=""
-d|--detach)
DETACH="-d"
shift
;;
--build)
BUILD="--build"
shift
;;
stop)
docker compose down
exit $?
;;
*)
# Pass remaining args to docker compose
docker compose "$@"
@@ -56,5 +61,5 @@ while [[ $# -gt 0 ]]; do
esac
done
# Default: up with options
# Default: up attached
docker compose up $DETACH $BUILD