Spaces:
Sleeping
Sleeping
| import type { NextConfig } from "next"; | |
| const nextConfig: NextConfig = { | |
| // Disable standalone for Railway deployment | |
| // Railway works better with standard Next.js build | |
| // output: "standalone", | |
| // Ignore lint/type errors during build for faster production build | |
| eslint: { | |
| ignoreDuringBuilds: true, | |
| }, | |
| typescript: { | |
| ignoreBuildErrors: true, | |
| }, | |
| // API Rewrites: Proxy /api/* requests to FastAPI backend | |
| // This simplifies reverse proxy configuration - users only need to proxy to port 8502 | |
| // Next.js handles internal routing to the API backend on port 5055 | |
| async rewrites() { | |
| // INTERNAL_API_URL: Where Next.js server-side should proxy API requests | |
| // Default: http://localhost:5055 (single-container deployment) | |
| // Override for multi-container: INTERNAL_API_URL=http://api-service:5055 | |
| const internalApiUrl = process.env.INTERNAL_API_URL || 'http://127.0.0.1:5055' | |
| console.log(`[Next.js Rewrites] Proxying /api/* to ${internalApiUrl}/api/*`) | |
| return [ | |
| { | |
| source: '/api/:path*', | |
| destination: `${internalApiUrl}/api/:path*`, | |
| }, | |
| ] | |
| }, | |
| }; | |
| export default nextConfig; | |