This commit is contained in:
10
Dockerfile
10
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"]
|
||||
|
||||
Reference in New Issue
Block a user