Files
cvfs/apps/webapp/next.config.ts
Claude de6b655911 Fix proxy default: use cvfs-backend:8080 instead of localhost:9812
API_BASE_URL env var isn't reaching Next.js in Dokploy, so the fallback
was localhost:9812. Default to the correct container hostname so it works
without any env var configuration. Local dev still overrides via API_BASE_URL.

https://claude.ai/code/session_01Xmxm2QLgFBgRJyYD6VukR6
2026-04-02 18:29:15 +00:00

15 lines
552 B
TypeScript

import type { NextConfig } from "next";
import path from "node:path";
const nextConfig: NextConfig = {
outputFileTracingRoot: path.join(process.cwd(), "../.."),
async rewrites() {
// In Docker (Dokploy/compose) the backend container is always reachable at cvfs-backend:8080.
// Override with API_BASE_URL for local dev (e.g. http://localhost:9812).
const backend = process.env.API_BASE_URL ?? "http://cvfs-backend:8080";
return [{ source: "/api/:path*", destination: `${backend}/api/:path*` }];
},
};
export default nextConfig;