Fix frontend API URL - use localhost instead of Docker DNS

The frontend container serves static files to the browser on the host machine.
When the browser makes HTTP requests from JavaScript, it runs in the host context,
not the Docker container context. Therefore it needs to use localhost:8000,
not api:8000 (which only works from inside Docker containers).

Changed: API_BASE_URL from 'http://api:8000' to 'http://localhost:8000'

This fixes the 'net::ERR_NAME_NOT_RESOLVED' error when trying to reach the API.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
John Patrick TeruelandCopilot committed 2026-04-24 21:06:59 +08:00
1 parent 53afc9e59f
commit 6749318253
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -88,10 +88,10 @@ services:
retries: 5
environment:
- NODE_ENV=production
- VITE_API_URL=http://api:8000
- VITE_API_URL=http://localhost:8000
restart: unless-stopped
# NOTE: All services now run in Docker on the same network
# Frontend: http://api:8000 (Docker service name resolution)
# Frontend: http://localhost:8000 (Docker service name resolution)
# Consumer: Still runs on host, connects to kafka:29092
volumes: