From fae94ed8b1e7815a0f930cbee1307e9bac99c60d Mon Sep 17 00:00:00 2001 From: streaper2 Date: Wed, 15 Apr 2026 22:18:13 +0200 Subject: [PATCH] fix build --- .dockerignore | 13 +++++++++++++ Dockerfile | 10 +++++----- app/api/businesses/[id]/view/route.ts | 1 + 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c87a625 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +node_modules +.next +.git +.gitea +*.log +npm-debug.log* +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +dist +build diff --git a/Dockerfile b/Dockerfile index c910baa..986772a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,14 +19,14 @@ COPY . . # Generate Prisma Client RUN DATABASE_URL="postgresql://dummy:dummy@localhost:5432/dummy" DEBUG=prisma:* npx prisma generate --schema=prisma/schema.prisma -# Build Next.js -RUN npm run build +# Clear any existing build artifacts and build +RUN rm -rf .next && npm run build # Production image, copy all the files and run next FROM base AS runner WORKDIR /app -ENV NODE_ENV production +ENV NODE_ENV=production RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs @@ -46,8 +46,8 @@ USER nextjs EXPOSE 3000 -ENV PORT 3000 -ENV HOSTNAME "0.0.0.0" +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" # Run migrations and start the server CMD ["sh", "-c", "npx prisma db push && node server.js"] diff --git a/app/api/businesses/[id]/view/route.ts b/app/api/businesses/[id]/view/route.ts index 26c9378..3bc3cd7 100644 --- a/app/api/businesses/[id]/view/route.ts +++ b/app/api/businesses/[id]/view/route.ts @@ -1,3 +1,4 @@ +// Force refresh for Next.js 16 params fix import { NextRequest, NextResponse } from 'next/server'; import prisma from '../../../../../lib/prisma';