From b0b29a1a065e81450edd498995c29c71f5137f78 Mon Sep 17 00:00:00 2001 From: liuyun Date: Wed, 21 Oct 2026 15:16:20 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20Dockerfile=20=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=89=8D=E5=85=88=20prisma=20migrate=20deploy=EF=BC=88?= =?UTF-8?q?=E5=B9=82=E7=AD=89=E5=BB=BA=E8=A1=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 61b27a2..d7e7fbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,5 @@ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm exec prisma generate && pnpm build EXPOSE 3000 -CMD ["node", "dist/main.js"] +# 启动前先跑 Prisma 迁移建表(幂等,已应用的迁移自动跳过),再起服务 +CMD ["sh", "-c", "pnpm exec prisma migrate deploy && node dist/main.js"]