dgx-spark-playbooks/nvidia/txt2kg/assets/frontend/next.config.mjs
Santosh Bhavani 0d5b85cdc5 Optimize Docker build with multi-stage caching
- Implement multi-stage Dockerfile (deps → builder → runner)
- Add BuildKit cache mounts for pnpm store and Next.js build cache
- Enable Next.js standalone output for smaller production images
- Create non-root user (nextjs:nodejs) with proper permissions
- Enhance .dockerignore to exclude more build artifacts
- Build time reduced from 225+ seconds to ~35 seconds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 13:48:36 -07:00

37 lines
960 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
// Configure external packages for server components
serverExternalPackages: ['@langchain/community'],
experimental: {
// webpackBuildWorker: true,
},
// Enable standalone output for optimized Docker builds
output: 'standalone',
// Make environment variables accessible to server components
env: {
NVIDIA_API_KEY: process.env.NVIDIA_API_KEY,
},
// Remove API route timeout limits for large model processing
serverRuntimeConfig: {
// No duration limit - let large models complete naturally
maxDuration: 0,
},
}
// Define environment variables that should be available to the client
const clientEnv = {
NVIDIA_API_KEY: process.env.NVIDIA_API_KEY,
// Other environment variables as needed
};
export default nextConfig