feat: add Prisma configuration file and update Dockerfile to include it
This commit is contained in:
@@ -7,6 +7,7 @@ WORKDIR /app
|
|||||||
# Kopiera backend-filer
|
# Kopiera backend-filer
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
COPY prisma ./prisma
|
COPY prisma ./prisma
|
||||||
|
COPY prisma.config.ts ./
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY tsconfig.json ./
|
COPY tsconfig.json ./
|
||||||
COPY nest-cli.json ./
|
COPY nest-cli.json ./
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from 'prisma/config';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
schema: 'prisma/schema.prisma',
|
||||||
|
migrations: {
|
||||||
|
path: 'prisma/migrations',
|
||||||
|
},
|
||||||
|
datasource: {
|
||||||
|
url: process.env.DATABASE_URL!,
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -4,7 +4,6 @@ generator client {
|
|||||||
|
|
||||||
datasource db {
|
datasource db {
|
||||||
provider = "mysql"
|
provider = "mysql"
|
||||||
url = env("DATABASE_URL")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
model Product {
|
model Product {
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ export class PrismaService
|
|||||||
{
|
{
|
||||||
private readonly logger = new Logger(PrismaService.name);
|
private readonly logger = new Logger(PrismaService.name);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super({ datasourceUrl: process.env.DATABASE_URL });
|
||||||
|
}
|
||||||
|
|
||||||
async onModuleInit() {
|
async onModuleInit() {
|
||||||
const maxAttempts = 10;
|
const maxAttempts = 10;
|
||||||
const delayMs = 3000;
|
const delayMs = 3000;
|
||||||
|
|||||||
Reference in New Issue
Block a user