-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
794f3d4
commit 1dd8a79
Showing
1 changed file
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ COPY config/ ./config/ | |
|
||
# Copiar código da API | ||
COPY apps/api/ ./apps/api/ | ||
COPY apps/api/prisma ./apps/api/prisma | ||
COPY apps/api/prisma ./apps/api/prisma | ||
|
||
# Instalar dependências | ||
RUN pnpm install --frozen-lockfile | ||
|
@@ -44,6 +44,14 @@ RUN cd apps/api && \ | |
RUN cd apps/api && \ | ||
pnpm build | ||
|
||
# Modificar a ordem e garantir geração do Prisma | ||
RUN cd apps/api && \ | ||
pnpm install --frozen-lockfile && \ | ||
pnpm add [email protected] && \ | ||
pnpm add @prisma/[email protected] && \ | ||
pnpm prisma generate --schema=./prisma/schema.prisma && \ | ||
pnpm build | ||
|
||
# Imagem de produção | ||
FROM node:20-alpine | ||
|
||
|
@@ -73,6 +81,13 @@ COPY --from=builder /app/apps/api/prisma ./apps/api/prisma | |
# Instalar apenas as dependências de produção | ||
RUN pnpm install --prod --frozen-lockfile | ||
|
||
# Adicionar estas linhas antes do CMD | ||
RUN cd /app/apps/api && \ | ||
pnpm prisma generate --schema=./prisma/schema.prisma | ||
|
||
# Garantir que o diretório .prisma existe e tem as permissões corretas | ||
RUN chown -R appuser:appgroup /app/apps/api/node_modules/.prisma | ||
|
||
USER appuser | ||
|
||
WORKDIR /app/apps/api | ||
|