From 782c0117d91ad75a1bb8d2aa89bc829881e1433a Mon Sep 17 00:00:00 2001 From: Guus van Meerveld Date: Mon, 13 Feb 2023 02:39:26 +0100 Subject: [PATCH] Run Prisma migrations on start in Docker --- Dockerfile | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a0ef853..cf57695 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,4 @@ USER nextjs EXPOSE 3000 -CMD ["yarn", "start"] \ No newline at end of file +CMD ["yarn", "run", "start:migrate"] \ No newline at end of file diff --git a/package.json b/package.json index 78c55a7..616d5ee 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "build": "next build", "start": "next start", "prisma:generate": "prisma generate", + "start:migrate": "prisma migrate deploy && yarn run start", "export": "next build && next export", "test-build": "tsc", "lint": "next lint",