Skip to content

Commit

Permalink
chore: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoPorfirio01 committed Dec 31, 2024
1 parent 7e8440a commit b4dae51
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ARG DATABASE_URL
# Passar o build argument para variável de ambiente
ENV DATABASE_URL=${DATABASE_URL}

# Instalar OpenSSL e outras dependências necessárias
RUN apk add --no-cache openssl openssl-dev

WORKDIR /app

# Instalar pnpm
Expand All @@ -26,8 +29,11 @@ COPY apps/api/ ./apps/api/
# Instalar dependências
RUN pnpm install --frozen-lockfile

# Atualizar @prisma/client para mesma versão do prisma
RUN cd apps/api && pnpm add @prisma/[email protected]

# Gerar Prisma Client
RUN cd apps/api && pnpm prisma generate && pnpm prisma migrate deploy
RUN cd apps/api && pnpm prisma generate

# Build
RUN pnpm --filter @chat/api build
Expand All @@ -37,6 +43,9 @@ FROM node:20-alpine

RUN addgroup -S appgroup && adduser -S appuser -G appgroup

# Instalar OpenSSL na imagem de produção também
RUN apk add --no-cache openssl

WORKDIR /app

RUN corepack enable && corepack prepare pnpm@latest --activate
Expand Down

0 comments on commit b4dae51

Please sign in to comment.