fix: 改用 sqlite3 原生工具做 schema 同步,替代不可靠的 prisma CLI 方案

This commit is contained in:
2026-02-28 17:33:49 +08:00
parent 3e7bb51618
commit bf806f0891
2 changed files with 27 additions and 9 deletions
+1 -4
View File
@@ -25,6 +25,7 @@ RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN apk add --no-cache sqlite
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
@@ -35,10 +36,6 @@ COPY --from=builder /app/prisma/template.db ./template.db
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Prisma CLI + schema engine for automatic schema migration on startup
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
COPY --from=builder /app/node_modules/@prisma/engines ./node_modules/@prisma/engines
COPY docker-entrypoint.sh ./
RUN chmod +x docker-entrypoint.sh