Skip to content

Commit

Permalink
chore: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoPorfirio01 committed Jan 1, 2025
1 parent 22009eb commit 7b2d527
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ COPY apps/api/ ./apps/api/
# Instalar dependências
RUN pnpm install --frozen-lockfile

# Atualizar @prisma/client e instalar prisma CLI
# Instalar dependências e garantir versões compatíveis do Prisma
RUN cd apps/api && \
pnpm add @prisma/[email protected] && \
pnpm add -D [email protected]
pnpm add -D [email protected] && \
pnpm install

# Gerar Prisma Client e fazer build
# Gerar Prisma Client explicitamente
RUN cd apps/api && \
pnpm exec prisma generate --schema=./prisma/schema.prisma

# Build após garantir que o Prisma Client foi gerado
RUN cd apps/api && \
pnpm exec prisma generate && \
pnpm build

# Imagem de produção
Expand Down Expand Up @@ -78,4 +82,8 @@ HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --no-verbose --tries=1 --spider http://localhost:3333/health || exit 1

# Comando de inicialização
CMD ["pnpm", "start"]
CMD ["pnpm", "start"]

# Garantir que o Prisma Client seja regenerado no ambiente de produção
RUN cd apps/api && \
pnpm exec prisma generate --schema=./prisma/schema.prisma

0 comments on commit 7b2d527

Please sign in to comment.