1 Commits
uat ... main

Author SHA1 Message Date
kevin-asprec
155f7af5ac feat: seed superadmin user on fresh deploy 2026-04-15 16:13:23 +08:00
2 changed files with 14 additions and 1 deletions

View File

@@ -34,7 +34,6 @@ COPY --from=builder /app/packages/shared/package.json ./packages/shared/
RUN node -e "const p=require('./packages/shared/package.json');p.main='./dist/index.js';require('fs').writeFileSync('./packages/shared/package.json',JSON.stringify(p,null,2))" RUN node -e "const p=require('./packages/shared/package.json');p.main='./dist/index.js';require('fs').writeFileSync('./packages/shared/package.json',JSON.stringify(p,null,2))"
COPY --from=builder /app/packages/db/prisma ./packages/db/prisma COPY --from=builder /app/packages/db/prisma ./packages/db/prisma
COPY --from=builder /app/packages/db/package.json ./packages/db/ COPY --from=builder /app/packages/db/package.json ./packages/db/
COPY --from=builder /app/packages/admin-db/prisma/seed.ts ./packages/admin-db/prisma/seed.ts
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist
ENV NODE_ENV=production ENV NODE_ENV=production

View File

@@ -0,0 +1,14 @@
-- Seed the platform superadmin user
-- Password: SuperAdmin@123 (bcrypt hash)
INSERT INTO "super_admins" ("id", "email", "password", "firstName", "lastName", "isActive", "createdAt", "updatedAt")
VALUES (
gen_random_uuid(),
'superadmin@fiberops.dev',
'$2b$12$wiW.foGm.5MD6FNz/HmBvuPaXJS56YPxxq5OEVCO6UXLOxTMvxL8S',
'Super',
'Admin',
true,
NOW(),
NOW()
)
ON CONFLICT ("email") DO NOTHING;