Compose brings up registry:3 plus a Prisma/SQLite Nuxt app for docker login, ACL management, and image browsing with shadcn-vue. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
477 B
TypeScript
23 lines
477 B
TypeScript
import { ensureTokenCerts } from './certs'
|
|
import { prisma } from './prisma'
|
|
import { seedAdmin } from '../../prisma/seed'
|
|
|
|
let ready: Promise<void> | null = null
|
|
|
|
async function bootstrap() {
|
|
ensureTokenCerts()
|
|
await prisma.$connect()
|
|
await seedAdmin(prisma)
|
|
}
|
|
|
|
export async function ensureBootstrap() {
|
|
if (!ready) {
|
|
ready = bootstrap().catch((err) => {
|
|
console.error('[bootstrap] failed', err)
|
|
ready = null
|
|
throw err
|
|
})
|
|
}
|
|
await ready
|
|
}
|