feat: add RUN_SEED support and support_ticket_attachments migration

- New migration: create support_ticket_attachments table
- Dockerfile: RUN_SEED=true env var triggers seed after migrations
This commit is contained in:
kevin-asprec
2026-04-15 06:05:28 +08:00
parent 88148e6fbb
commit 5cdbd36999
2 changed files with 25 additions and 1 deletions

View File

@@ -39,4 +39,4 @@ COPY --from=builder /app/dist ./dist
ENV NODE_ENV=production
EXPOSE 3004
ENTRYPOINT ["dumb-init", "--"]
CMD ["sh", "-c", "cd packages/admin-db && npx prisma migrate deploy && cd /app && node dist/main.js"]
CMD ["sh", "-c", "cd packages/admin-db && npx prisma migrate deploy && if [ \"$RUN_SEED\" = \"true\" ]; then echo 'Seeding admin database...' && npx tsx prisma/seed.ts; fi && cd /app && node dist/main.js"]