Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 9421c5b

Browse files
committed
chore: prisma problema
1 parent c66f5c8 commit 9421c5b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Docker/prisma-init.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
const { execSync } = require('child_process')
22

33
try {
4-
console.log('Running Prisma migrations...')
4+
console.log('Generating Prisma Client...')
55
execSync('npx prisma generate', { stdio: 'inherit' })
6+
7+
console.log('Running Prisma migrations...')
68
execSync('npx prisma migrate deploy', { stdio: 'inherit' })
79
console.log('Prisma migrations completed successfully.')
810

Docker/start-server.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
#!/bin/sh
2+
23
echo "Bem-vindo ao EduPrime Hub!"
34
echo "Aguardando a inicialização do banco de dados..."
4-
sleep 20
5+
6+
# Verifica se o banco de dados está acessível antes de prosseguir
7+
node check-db-connection.js
8+
9+
# Gera o cliente Prisma
10+
npx prisma generate
11+
12+
# Aplica as migrações do Prisma
13+
node prisma-init.js
14+
515
echo "As APIs estão disponíveis na porta 3000."
6-
node check-db-connection.js && pnpm run start:prod
16+
17+
# Inicia o servidor
18+
npm run start:prod

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
1111
POSTGRES_HOST_AUTH_METHOD: trust
1212
ports:
13-
- '${POSTGRES_PORT}:5432'
13+
- '5432:5432'
1414
volumes:
1515
- eduprimedb_data:/var/lib/postgresql/data
1616
healthcheck:
@@ -20,7 +20,7 @@ services:
2020
retries: 5
2121

2222
eduprime_core:
23-
image: softagon/eduprimecore:0.1
23+
image: softagon/eduprimecore:latest
2424
container_name: eduprime-core
2525
env_file:
2626
- .env

0 commit comments

Comments
 (0)