The mkdir was running before the standalone COPY, which could overwrite
/app/data contents or permissions. Move it to after all COPY statements
and use chmod 700 so only nextjs owns and can write the SQLite data dir.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
npm ci with a Windows-generated lockfile skips @libsql/linux-x64-musl
(optional native dep). Switching to npm install lets npm resolve the
correct platform-specific binary for the Alpine container. Also copy
node_modules into the runner stage so prisma db push and the libsql
native module are available at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PrismaLibSql constructor takes a Config object (with url), not a
pre-created Client instance. Remove the unnecessary createClient call
and the @libsql/client direct dependency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
apk upgrade hangs on slow/unreliable Alpine mirrors and is not needed
for a build. node:20-alpine is sufficiently up to date.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
prisma.config.ts is a Prisma CLI config file, not part of the Next.js
app — exclude it from tsconfig to prevent type errors. Also revert the
migrate.adapter block (not a valid PrismaConfig key in 7.5) back to
datasource.url which is the correct CLI config for db push.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@libsql/client and libsql contain native bindings and non-JS assets
(README.md, LICENSE) that webpack cannot parse. Mark them as server
external packages so Next.js requires them at runtime instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prisma 7 removed support for `url` in schema.prisma datasources and the
`engineType = "library"` native binary engine. All connections now go
through a driver adapter.
- Remove engineType and url from schema.prisma (no longer supported)
- Configure prisma.config.ts with migrate.adapter using @libsql/client
- Instantiate PrismaClient with PrismaLibSQL adapter in src/lib/prisma.ts
- Add @libsql/client and @prisma/adapter-libsql dependencies
- Remove PRISMA_CLIENT_ENGINE_TYPE from Dockerfile (obsolete)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prisma 7's prisma.config.ts only configures the CLI, not the runtime
PrismaClient. Without url in the datasource block, the generated client
defaults to engineType "client" (WASM) which requires an adapter,
causing next-auth adapter errors on OAuth callback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>