This commit is contained in:
13
.dockerignore
Normal file
13
.dockerignore
Normal file
@@ -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
|
||||||
10
Dockerfile
10
Dockerfile
@@ -19,14 +19,14 @@ COPY . .
|
|||||||
# Generate Prisma Client
|
# Generate Prisma Client
|
||||||
RUN DATABASE_URL="postgresql://dummy:dummy@localhost:5432/dummy" DEBUG=prisma:* npx prisma generate --schema=prisma/schema.prisma
|
RUN DATABASE_URL="postgresql://dummy:dummy@localhost:5432/dummy" DEBUG=prisma:* npx prisma generate --schema=prisma/schema.prisma
|
||||||
|
|
||||||
# Build Next.js
|
# Clear any existing build artifacts and build
|
||||||
RUN npm run build
|
RUN rm -rf .next && npm run build
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
RUN adduser --system --uid 1001 nextjs
|
||||||
@@ -46,8 +46,8 @@ USER nextjs
|
|||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
ENV PORT 3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME "0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
# Run migrations and start the server
|
# Run migrations and start the server
|
||||||
CMD ["sh", "-c", "npx prisma db push && node server.js"]
|
CMD ["sh", "-c", "npx prisma db push && node server.js"]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// Force refresh for Next.js 16 params fix
|
||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
import prisma from '../../../../../lib/prisma';
|
import prisma from '../../../../../lib/prisma';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user