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
parent
3a961c09ce
commit
4b7f7887ee
|
|
@ -20,6 +20,7 @@ COPY shared ./shared
|
||||||
|
|
||||||
# Generate Prisma client
|
# Generate Prisma client
|
||||||
WORKDIR /app/apps/api
|
WORKDIR /app/apps/api
|
||||||
|
COPY apps/api/prisma.config.ts ./
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
|
|
||||||
# Build the app
|
# 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/dist ./apps/api/dist
|
||||||
COPY --from=builder /app/apps/api/package.json ./apps/api/package.json
|
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 ./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/dist ./shared/dist
|
||||||
COPY --from=builder /app/shared/package.json ./shared/package.json
|
COPY --from=builder /app/shared/package.json ./shared/package.json
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,5 @@
|
||||||
],
|
],
|
||||||
"coverageDirectory": "../coverage",
|
"coverageDirectory": "../coverage",
|
||||||
"testEnvironment": "node"
|
"testEnvironment": "node"
|
||||||
},
|
|
||||||
"prisma": {
|
|
||||||
"seed": "ts-node prisma/seed.ts"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { defineConfig } from 'prisma/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
seed: {
|
||||||
|
command: 'ts-node prisma/seed.ts',
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue