fix: bootstrap prisma data before app start
This commit is contained in:
@@ -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.
|
- `NEXT_PUBLIC_SITE_URL` should match the deployed environment.
|
||||||
- `DATABASE_URL` should target the environment-specific PostgreSQL instance.
|
- `DATABASE_URL` should target the environment-specific PostgreSQL instance.
|
||||||
- Stripe and email provider secrets live in environment variables.
|
- 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
|
## Port Mapping
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ RUN npm run build
|
|||||||
|
|
||||||
EXPOSE 3000
|
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"]
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:e2e": "playwright test",
|
"test:e2e": "playwright test",
|
||||||
"prisma:generate": "prisma generate",
|
"prisma:generate": "prisma generate",
|
||||||
|
"prisma:migrate:deploy": "prisma migrate deploy",
|
||||||
"prisma:migrate:dev": "prisma migrate dev",
|
"prisma:migrate:dev": "prisma migrate dev",
|
||||||
"prisma:seed": "tsx prisma/seed.ts"
|
"prisma:seed": "tsx prisma/seed.ts"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user