fix(docker): ensure prisma generate runs on build and add explicit admin model types
This commit is contained in:
@@ -8,6 +8,7 @@ WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json package-lock.json* ./
|
||||
COPY prisma ./prisma/
|
||||
RUN npm ci --legacy-peer-deps
|
||||
|
||||
|
||||
@@ -17,6 +18,9 @@ WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Generate Prisma Client
|
||||
RUN npx prisma generate
|
||||
|
||||
# Environment variables must be present at build time for Next.js
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { redirect } from 'next/navigation';
|
||||
import { Trash2, CheckCircle } from 'lucide-react';
|
||||
import { deleteContact, markContactAsRead } from '../actions';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import type { ContactMessage } from '@prisma/client';
|
||||
|
||||
export default async function ContactAdminPage() {
|
||||
const session = await getSession();
|
||||
@@ -31,7 +32,7 @@ export default async function ContactAdminPage() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{messages.map(msg => (
|
||||
{messages.map((msg: ContactMessage) => (
|
||||
<tr key={msg.id} className="border-b border-slate-200 dark:border-slate-800 hover:bg-slate-50 dark:hover:bg-slate-800/50">
|
||||
<td className="p-4 text-sm">{msg.createdAt.toLocaleDateString('tr-TR')}</td>
|
||||
<td className="p-4 text-sm font-medium">{msg.name}</td>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { redirect } from 'next/navigation';
|
||||
import { Trash2, Plus } from 'lucide-react';
|
||||
import { addGalleryItem, deleteGalleryItem } from '../actions';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import type { Gallery } from '@prisma/client';
|
||||
|
||||
export default async function GalleryAdminPage() {
|
||||
const session = await getSession();
|
||||
@@ -61,7 +62,7 @@ export default async function GalleryAdminPage() {
|
||||
<h2 className="text-xl font-bold mb-6">Mevcut Resimler ({galleryItems.length})</h2>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||
{galleryItems.map(item => (
|
||||
{galleryItems.map((item: Gallery) => (
|
||||
<div key={item.id} className="group relative rounded-xl overflow-hidden border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800">
|
||||
<div className="aspect-video w-full overflow-hidden bg-slate-200 dark:bg-slate-700">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { redirect } from 'next/navigation';
|
||||
import { Trash2, Plus, Briefcase } from 'lucide-react';
|
||||
import { addServiceItem, deleteServiceItem } from '../actions';
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import type { Service } from '@prisma/client';
|
||||
|
||||
export default async function ServicesAdminPage() {
|
||||
const session = await getSession();
|
||||
@@ -61,7 +62,7 @@ export default async function ServicesAdminPage() {
|
||||
<h2 className="text-xl font-bold mb-6">Mevcut Hizmetler ({services.length})</h2>
|
||||
|
||||
<div className="space-y-4">
|
||||
{services.map(item => (
|
||||
{services.map((item: Service) => (
|
||||
<div key={item.id} className="group relative flex items-start space-x-4 p-4 rounded-xl border border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800">
|
||||
<div className="flex-shrink-0 p-3 bg-white dark:bg-slate-900 rounded-lg border border-slate-200 dark:border-slate-700">
|
||||
{item.iconUrl ? (
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"build": "prisma generate && next build",
|
||||
"start": "next start",
|
||||
"lint": "eslint"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user