Files
enclava/frontend/next.config.js
Aljaz Ceru 407e14faa6 Fix Docker build with Next.js standalone output
- Enable outputStandalone in next.config.js for better Docker compatibility
- Update Dockerfile to properly copy standalone output files
- Change CMD to use node server.js for standalone builds
- This should resolve the @/lib module resolution issues in Docker builds
2025-09-15 20:10:29 +02:00

56 lines
1.3 KiB
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
// Disable ESLint and TypeScript checking during builds to allow test environment to start
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
experimental: {
// Enable standalone output for better Docker compatibility
outputStandalone: true,
},
webpack: (config, { isServer, dev }) => {
config.resolve.alias = {
...config.resolve.alias,
'@': require('path').join(__dirname, 'src'),
};
// Optional: Add debug logging
if (dev) {
console.log('Webpack alias config:', config.resolve.alias);
}
return config;
},
env: {
NEXT_PUBLIC_BASE_URL: process.env.NEXT_PUBLIC_BASE_URL,
NEXT_PUBLIC_APP_NAME: process.env.NEXT_PUBLIC_APP_NAME || 'Enclava', // Sane default
},
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'strict-origin-when-cross-origin',
},
],
},
];
},
};
module.exports = nextConfig;