From 7995b65ebe57f5b8196d4aa7467e6242edb04a82 Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 18 Nov 2025 17:13:21 +0100 Subject: [PATCH] fix: revert to standard Docker build (standalone incompatible with SSR errors) --- Dockerfile | 9 +++++---- app/login/page.tsx | 2 ++ next.config.js | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f60c89..238bd58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,10 +25,11 @@ FROM node:20-alpine AS runner WORKDIR /app ENV NODE_ENV=production -# Copy standalone server and dependencies -COPY --from=builder /app/.next/standalone ./ -COPY --from=builder /app/.next/static ./.next/static +# Copy Next.js build output and dependencies +COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public +COPY --from=builder /app/package*.json ./ +COPY --from=builder /app/node_modules ./node_modules # Set environment variables at runtime ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL @@ -37,4 +38,4 @@ ENV NEXT_PUBLIC_GOOGLE_CLIENT_ID=$NEXT_PUBLIC_GOOGLE_CLIENT_ID ENV NEXT_PUBLIC_FACEBOOK_APP_ID=$NEXT_PUBLIC_FACEBOOK_APP_ID EXPOSE 3000 -CMD ["node", "server.js"] +CMD ["npm", "run", "start"] diff --git a/app/login/page.tsx b/app/login/page.tsx index 379d6d8..42eaddc 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -14,6 +14,8 @@ import { initFacebookSDK, loginWithFacebook } from "@/lib/facebook-sdk"; import toast from "react-hot-toast"; export const dynamic = 'force-dynamic'; +export const dynamicParams = true; +export const revalidate = 0; export default function LoginPage() { const { login, googleLogin, facebookLogin } = useAuth(); diff --git a/next.config.js b/next.config.js index b411d4e..5a2ae88 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - output: 'standalone', env: { NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, }, @@ -16,6 +15,8 @@ const nextConfig = { experimental: { missingSuspenseWithCSRBailout: false, }, + // Generate error pages instead of failing build on prerender errors + staticPageGenerationTimeout: 120, }; module.exports = nextConfig;