From 4995101dd187bd45fea10ef654925765ed39dc47 Mon Sep 17 00:00:00 2001 From: Yves Gugger Date: Sat, 20 Dec 2025 23:39:43 +0100 Subject: [PATCH] fix: Frontend proxy uses pounce-backend in production - next.config.js now detects NODE_ENV=production - Uses http://pounce-backend:8000 in Docker instead of localhost - Logs backend URL during build for debugging --- frontend/next.config.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index a34a437..9d8da08 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -161,8 +161,12 @@ const nextConfig = { // Proxy API requests to backend // This ensures /api/v1/* works regardless of how the server is accessed async rewrites() { - // Determine backend URL based on environment - const backendUrl = process.env.BACKEND_URL || 'http://127.0.0.1:8000' + // In production (Docker), use internal container hostname + // In development, use localhost + const isProduction = process.env.NODE_ENV === 'production' + const backendUrl = process.env.BACKEND_URL || (isProduction ? 'http://pounce-backend:8000' : 'http://127.0.0.1:8000') + + console.log(`[Next.js Config] Backend URL: ${backendUrl}`) return [ {