feat: add Prisma configuration file and update Dockerfile to include it

This commit is contained in:
Nils-Johan Gynther
2026-04-15 20:53:45 +02:00
parent 944a670a84
commit c9ef587eb1
4 changed files with 16 additions and 1 deletions
+1
View File
@@ -7,6 +7,7 @@ WORKDIR /app
# Kopiera backend-filer
COPY package.json ./
COPY prisma ./prisma
COPY prisma.config.ts ./
COPY src ./src
COPY tsconfig.json ./
COPY nest-cli.json ./
+11
View File
@@ -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!,
},
});
-1
View File
@@ -4,7 +4,6 @@ generator client {
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model Product {
+4
View File
@@ -8,6 +8,10 @@ export class PrismaService
{
private readonly logger = new Logger(PrismaService.name);
constructor() {
super({ datasourceUrl: process.env.DATABASE_URL });
}
async onModuleInit() {
const maxAttempts = 10;
const delayMs = 3000;