|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
// Only use standalone output for Docker builds
|
|
...(process.env.NODE_ENV === 'production' && { output: 'standalone' }),
|
|
|
|
env: {
|
|
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || 'https://candivista.com',
|
|
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || 'pk_test_your_publishable_key_here',
|
|
},
|
|
|
|
// Only add rewrites for production (Docker)
|
|
...(process.env.NODE_ENV === 'production' && {
|
|
async rewrites() {
|
|
const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'https://candivista.com';
|
|
return [
|
|
{
|
|
source: '/rest/:path*',
|
|
destination: `${apiUrl}/rest/:path*`,
|
|
},
|
|
];
|
|
},
|
|
}),
|
|
}
|
|
|
|
module.exports = nextConfig
|