From d5a3372d6b70cf2072c2ff596e03207303785df8 Mon Sep 17 00:00:00 2001 From: buenosairesam Date: Fri, 13 Mar 2026 14:59:32 -0300 Subject: [PATCH] ui selector --- ctrl/docker-compose.yml | 13 +++++ ctrl/landing.html | 107 +++++++++++++++++++++++++++++++++++++ ctrl/nginx.conf | 42 +++++++++++---- ui/chunker/.dockerignore | 2 + ui/chunker/Dockerfile | 12 +++++ ui/chunker/vite.config.ts | 4 ++ ui/timeline/vite.config.ts | 4 ++ 7 files changed, 173 insertions(+), 11 deletions(-) create mode 100644 ctrl/landing.html create mode 100644 ui/chunker/.dockerignore create mode 100644 ui/chunker/Dockerfile diff --git a/ctrl/docker-compose.yml b/ctrl/docker-compose.yml index bfbf700..df2678c 100644 --- a/ctrl/docker-compose.yml +++ b/ctrl/docker-compose.yml @@ -95,10 +95,12 @@ services: - "80:80" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./landing.html:/etc/nginx/landing.html:ro depends_on: - django - fastapi - timeline + - chunker - minio # ============================================================================= @@ -162,6 +164,17 @@ services: volumes: - ../ui/timeline/src:/app/src + chunker: + build: + context: ../ui/chunker + dockerfile: Dockerfile + ports: + - "5174:5174" + environment: + VITE_ALLOWED_HOSTS: ${VITE_ALLOWED_HOSTS:-} + volumes: + - ../ui/chunker/src:/app/src + volumes: postgres-data: redis-data: diff --git a/ctrl/landing.html b/ctrl/landing.html new file mode 100644 index 0000000..7ecfafc --- /dev/null +++ b/ctrl/landing.html @@ -0,0 +1,107 @@ + + + + + + MPR + + + +
+

MPR

+

Media Processing & Review

+ + +
+ + diff --git a/ctrl/nginx.conf b/ctrl/nginx.conf index 526539e..b20c6ac 100644 --- a/ctrl/nginx.conf +++ b/ctrl/nginx.conf @@ -21,6 +21,10 @@ http { server timeline:5173; } + upstream chunker { + server chunker:5174; + } + upstream minio { server minio:9000; } @@ -29,6 +33,12 @@ http { listen 80; server_name mpr.local.ar; + # Landing page + location = / { + root /etc/nginx; + try_files /landing.html =404; + } + # Django Admin location /admin { proxy_pass http://django; @@ -54,7 +64,7 @@ http { } # Timeline UI - location /ui { + location /timeline/ { proxy_pass http://timeline; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -62,8 +72,17 @@ http { proxy_set_header Connection "upgrade"; } - # Vite HMR websocket - location /@vite { + # Chunker UI + location /chunker/ { + proxy_pass http://chunker; + 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 (timeline) + location /timeline/@vite { proxy_pass http://timeline; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -71,6 +90,15 @@ http { proxy_set_header Host $host; } + # Vite HMR websocket (chunker) + location /chunker/@vite { + proxy_pass http://chunker; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + } + # Media files - proxied from MinIO (local) or S3 (AWS) location /media/in/ { proxy_pass http://minio/mpr-media-in/; @@ -81,13 +109,5 @@ http { proxy_pass http://minio/mpr-media-out/; proxy_set_header Host $http_host; } - - # Default to Timeline UI - location / { - proxy_pass http://timeline; - proxy_set_header Host $host; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } } } diff --git a/ui/chunker/.dockerignore b/ui/chunker/.dockerignore new file mode 100644 index 0000000..b947077 --- /dev/null +++ b/ui/chunker/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ diff --git a/ui/chunker/Dockerfile b/ui/chunker/Dockerfile new file mode 100644 index 0000000..0f0d6ab --- /dev/null +++ b/ui/chunker/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json ./ +RUN npm install + +COPY . . + +EXPOSE 5174 + +CMD ["npm", "run", "dev"] diff --git a/ui/chunker/vite.config.ts b/ui/chunker/vite.config.ts index 4e84de9..76aa6aa 100644 --- a/ui/chunker/vite.config.ts +++ b/ui/chunker/vite.config.ts @@ -2,11 +2,15 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ + base: "/chunker/", plugins: [react()], server: { host: "0.0.0.0", port: 5174, allowedHosts: process.env.VITE_ALLOWED_HOSTS?.split(",") || [], + hmr: { + path: "/chunker/@vite/client", + }, proxy: { "/api": { target: "http://fastapi:8702", diff --git a/ui/timeline/vite.config.ts b/ui/timeline/vite.config.ts index e38695c..39fb7ac 100644 --- a/ui/timeline/vite.config.ts +++ b/ui/timeline/vite.config.ts @@ -2,11 +2,15 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ + base: "/timeline/", plugins: [react()], server: { host: "0.0.0.0", port: 5173, allowedHosts: process.env.VITE_ALLOWED_HOSTS?.split(",") || [], + hmr: { + path: "/timeline/@vite/client", + }, proxy: { "/api": { target: "http://fastapi:8702",