-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
docker/frontend/Dockerfile has build-time args:
ARG VITE_BACKEND_HOST=autobot-backend
ARG VITE_BACKEND_PORT=8000
ARG VITE_HTTP_PROTOCOL=httpThese values are baked into the frontend JS bundle at build time. autobot-backend is only resolvable inside the Docker network — when a browser accesses the frontend from outside Docker, API calls to http://autobot-backend:8000 will fail (DNS resolution fails in browser context).
Impact
Medium — frontend works inside Docker network but API calls fail from any external browser. The nginx reverse proxy partially mitigates this by routing /api to the backend, but any direct API URL construction in frontend code will break.
Expected Fix
Frontend should use relative URLs (/api/...) resolved through nginx, not absolute URLs with container hostnames. Build args should default to empty or relative:
ARG VITE_BACKEND_HOST=
ARG VITE_BACKEND_PORT=
ARG VITE_HTTP_PROTOCOL=Or use runtime config injection via nginx sub_filter or env.js pattern.
Discovered During
Working on #1809 Docker containerization.