Migrate Prisma seed configuration to `prisma.config.ts` and update API Dockerfile

- Move `prisma.seed` from `package.json` to new `prisma.config.ts`.
- Modify API Dockerfile to include `prisma.config.ts` in the build process.
main
Pau Costa Ferrer 2026-03-28 18:56:40 +01:00
parent 3a961c09ce
commit 4b7f7887ee
3 changed files with 9 additions and 3 deletions

View File

@ -20,6 +20,7 @@ COPY shared ./shared
# Generate Prisma client
WORKDIR /app/apps/api
COPY apps/api/prisma.config.ts ./
RUN npx prisma generate
# Build the app
@ -35,6 +36,7 @@ COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/api/dist ./apps/api/dist
COPY --from=builder /app/apps/api/package.json ./apps/api/package.json
COPY --from=builder /app/apps/api/prisma ./apps/api/prisma
COPY --from=builder /app/apps/api/prisma.config.ts ./apps/api/prisma.config.ts
COPY --from=builder /app/shared/dist ./shared/dist
COPY --from=builder /app/shared/package.json ./shared/package.json

View File

@ -84,8 +84,5 @@
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
}
}

View File

@ -0,0 +1,7 @@
import { defineConfig } from 'prisma/config';
export default defineConfig({
seed: {
command: 'ts-node prisma/seed.ts',
},
});