diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 3c16db7..c447b3d 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -9,6 +9,7 @@ The deployment model is expected to follow the shared dev, QA, and production br - `NEXT_PUBLIC_SITE_URL` should match the deployed environment. - `DATABASE_URL` should target the environment-specific PostgreSQL instance. - Stripe and email provider secrets live in environment variables. +- The production container applies Prisma migrations and seeds the property inventory before the Next.js server starts so checkout has the required `Property` records. ## Port Mapping diff --git a/Dockerfile b/Dockerfile index cccc7ad..c358f02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ RUN npm run build EXPOSE 3000 -CMD ["node", ".next/standalone/server.js"] +CMD ["sh", "-c", "npm run prisma:migrate:deploy && npm run prisma:seed && node .next/standalone/server.js"] diff --git a/package.json b/package.json index 208a90d..efa1719 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "test": "vitest run", "test:e2e": "playwright test", "prisma:generate": "prisma generate", + "prisma:migrate:deploy": "prisma migrate deploy", "prisma:migrate:dev": "prisma migrate dev", "prisma:seed": "tsx prisma/seed.ts" },