diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 4a99c9b..4967c4a 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -13,6 +13,8 @@ COPY webapp/ . # Set environment variables for build ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 +# Use a dummy DB_URI during build to prevent connection attempts +ENV DB_URI=mongodb://dummy:password@localhost:27017/dummy # Build the application RUN npm run build diff --git a/webapp/next.config.js b/webapp/next.config.js index 92ce88a..c593871 100644 --- a/webapp/next.config.js +++ b/webapp/next.config.js @@ -11,6 +11,14 @@ const nextConfig = { // to prevent database connection attempts serverComponentsExternalPackages: ['mongoose'], }, + // Disable server-side rendering during build for specific pages that require DB access + // This prevents connection attempts during build + exportPathMap: async function() { + return { + '/': { page: '/dashboard' }, + // Add other static pages here + }; + }, async redirects() { return [ { // we redirect '/' to '/dashboard