diff --git a/Docker/start-server.sh b/Docker/start-server.sh index aea1976..2217d7e 100755 --- a/Docker/start-server.sh +++ b/Docker/start-server.sh @@ -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 diff --git a/Dockerfile b/Dockerfile index 3d617a8..d5e2463 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . . @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 7b96f2b..3aef088 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -29,6 +33,12 @@ services: condition: service_healthy ports: - '3000:3000' + networks: + - eduprime-network + +networks: + eduprime-network: + driver: bridge volumes: eduprimedb_data: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18523ff..c338358 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@prisma/client': specifier: ^5.14.0 version: 5.14.0(prisma@5.14.0) + dotenv: + specifier: ^16.4.5 + version: 16.4.5 fastify: specifier: ^4.27.0 version: 4.27.0 @@ -1368,6 +1371,10 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} + dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -4742,6 +4749,8 @@ snapshots: dependencies: path-type: 4.0.0 + dotenv@16.4.5: {} + eastasianwidth@0.2.0: {} ee-first@1.1.1: {}