From f2d89d8333560bf87cec0f54f897d8f2421837d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 23 Nov 2025 19:00:34 +0100 Subject: [PATCH] fix: enable standalone output and remove public directory copy - Re-enable output: 'standalone' in next.config.ts for Docker builds - Remove public directory copy from Dockerfile (not needed for this project) - Standalone mode works with force-dynamic routing to prevent SSR issues Fixes Gitea Actions build failure where .next/standalone was not found --- Dockerfile | 4 ++-- next.config.ts | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ea7eed..ec1341a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,8 +49,8 @@ RUN addgroup --system --gid 1001 nodejs && \ adduser --system --uid 1001 nextjs # Copy necessary files from builder -COPY --from=builder /app/public ./public -COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +# Note: public directory is optional - only copy if it exists +COPY --from=builder /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # Switch to non-root user diff --git a/next.config.ts b/next.config.ts index 31bb80d..130bf5b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,8 +2,7 @@ import type { NextConfig } from 'next'; const nextConfig: NextConfig = { reactStrictMode: true, - // Note: Using default mode (not standalone) to avoid SSR issues with client components - // For Docker, we'll use regular server mode which works fine + output: 'standalone', }; export default nextConfig;