Seed household on container startup via seed.mjs
Without a household row the signIn callback has nothing to attach the first user to, causing "No household membership" on first load. Add scripts/seed.mjs (plain ESM, only needs postgres which is already in the image) and run it from the entrypoint after migrations. Idempotent — skips if a household already exists. Default calendars/lists are created by the signIn callback when the first user authenticates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
1e076bd2f3
commit
c66bf68373
@@ -38,6 +38,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
# the app itself imports, not the postgres-js/migrator subpath.
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/drizzle ./drizzle
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts/migrate.mjs ./scripts/migrate.mjs
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts/seed.mjs ./scripts/seed.mjs
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/drizzle-orm ./node_modules/drizzle-orm
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/postgres ./node_modules/postgres
|
||||
COPY --chown=nextjs:nodejs docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
Reference in New Issue
Block a user