phase 1
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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">◎</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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
21
ctrl/run.sh
21
ctrl/run.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user