- Add lib/db (Drizzle schema: 7 tables + 6 enums + relations, postgres.js client), drizzle.config.ts, lib/db/enums.ts (Prisma-compatible enum objects) - Rewrite all 14 app consumers + 4 admin components to Drizzle - Move the test DB layer to Drizzle + in-process PGlite; convert all 8 integration test files + factories (371 tests green) - Remove Prisma: deps, prisma/ schema+migrations, lib/prisma.ts, Dockerfile prisma generate; wire db:generate/migrate/push/studio to drizzle-kit; update Makefile - Preserve the old seed as scripts/legacy-prisma-seed.cjs (needs a Drizzle rewrite)
27 lines
898 B
Docker
27 lines
898 B
Docker
FROM node:22-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
COPY --from=builder /app/package*.json ./
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/.next ./.next
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/drizzle.config.ts ./drizzle.config.ts
|
|
COPY --from=builder /app/lib/db ./lib/db
|
|
COPY --from=builder /app/next.config.mjs ./next.config.mjs
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["/bin/sh", "-c", "set -e; mkdir -p /app/public/uploads/media && echo '[startup] Running database migrations...' && npm run db:migrate && echo '[startup] Migrations complete. Starting server...' && npm run start -- --hostname 0.0.0.0 --port 3000"]
|