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

Commit

Permalink
fix: test connection database before start
Browse files Browse the repository at this point in the history
  • Loading branch information
hermesalvesbr committed May 25, 2024
1 parent 9421c5b commit ea00c33
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
3 changes: 0 additions & 3 deletions Docker/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ echo "Aguardando a inicialização do banco de dados..."
# Verifica se o banco de dados está acessível antes de prosseguir
node check-db-connection.js

# Gera o cliente Prisma
npx prisma generate

# Aplica as migrações do Prisma
node prisma-init.js

Expand Down
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ COPY package.json pnpm-lock.yaml ./
# Instale as dependências do projeto usando pnpm
RUN pnpm install

# Instale as dependências de produção
RUN pnpm install --prod

# Copie o restante do código da aplicação
COPY . .

Expand All @@ -44,8 +41,5 @@ COPY Docker/check-db-connection.js ./check-db-connection.js
COPY Docker/prisma-init.js ./prisma-init.js
COPY Docker/start-server.sh ./start-server.sh

# Gere o cliente Prisma com os binários corretos
RUN npx prisma generate

# Defina o comando padrão para iniciar a aplicação
CMD ["./start-server.sh"]
12 changes: 11 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ services:
interval: 30s
timeout: 10s
retries: 5
networks:
- eduprime-network

eduprime_core:
image: softagon/eduprimecore:latest
build:
context: .
dockerfile: Dockerfile
container_name: eduprime-core
env_file:
- .env
Expand All @@ -29,6 +33,12 @@ services:
condition: service_healthy
ports:
- '3000:3000'
networks:
- eduprime-network

networks:
eduprime-network:
driver: bridge

volumes:
eduprimedb_data:
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea00c33

Please sign in to comment.