Ubuntu Claude Opus 4.7 commited on
Commit
b9c6688
·
1 Parent(s): f4d645e

fix(dashboard): drop /api prefix in prod build

Browse files

The dev setup uses Vite's /api → :8765 proxy with a rewrite that
strips the prefix. In prod the dashboard and FastAPI share an origin
with no rewrite, so /api/scenarios was 404-ing and the UI got stuck
on 'Loading scenarios…'. Set VITE_API_BASE="" so the built bundle
calls /scenarios, /predict, /query, /health directly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile +2 -2
Dockerfile CHANGED
@@ -7,8 +7,8 @@ WORKDIR /app/dashboard
7
  COPY dashboard/package.json dashboard/package-lock.json* ./
8
  RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund
9
  COPY dashboard/ ./
10
- # Hit the FastAPI at the same origin in prod, no dev proxy.
11
- ENV VITE_API_BASE=/api
12
  RUN npm run build
13
 
14
  # ---------- Stage 2: Python runtime ----------
 
7
  COPY dashboard/package.json dashboard/package-lock.json* ./
8
  RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund
9
  COPY dashboard/ ./
10
+ # Same-origin FastAPI in prod routes are unprefixed (no dev /api rewrite).
11
+ ENV VITE_API_BASE=""
12
  RUN npm run build
13
 
14
  # ---------- Stage 2: Python runtime ----------