fix(web): proxy client API calls through Next.js to fix production connectivity
NEXT_PUBLIC_API_URL was undefined at build time, causing client bundles to fall back to http://localhost:3001 — unreachable from the browser in prod. - Add /api-proxy rewrite in next.config.ts (forwards to API_INTERNAL_URL at runtime) - Bake NEXT_PUBLIC_API_URL=/api-proxy at build time in Dockerfile - Fix api.ts to prefer API_INTERNAL_URL for server-side calls - Fix docker-compose.prod.yml: set NEXT_PUBLIC_API_URL=http://api:3001 for runtime server-side code Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ services:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
HOSTNAME: "0.0.0.0"
|
||||
NEXT_PUBLIC_API_URL: ${APP_URL:-http://localhost:3001}
|
||||
NEXT_PUBLIC_API_URL: http://api:3001
|
||||
API_INTERNAL_URL: "http://api:3001"
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
networks:
|
||||
|
||||
Reference in New Issue
Block a user