Skip to content

Commit

Permalink
updates prisma package to resolve openssl error in build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandersimoes committed Dec 12, 2024
1 parent c336f3b commit 8e7dc79
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Dependencies: Install only when needed
FROM node:20-slim AS deps
FROM node:20-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN apt-get update && apt-get install -y openssl && \
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi

# Builder: Build the source code only when needed
FROM node:20-slim AS builder
FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
Expand All @@ -36,13 +38,12 @@ RUN npm run build
#RUN yarn build

# Runner: Production image, copy all the files and run next
FROM node:20-slim AS runner
FROM node:20-alpine AS runner
WORKDIR /app

# Install OpenSSL
RUN apt-get update && apt-get install -y openssl

# Comment the following line in case you want to enable telemetry during runtime
ENV NEXT_TELEMETRY_DISABLED 1

ENV NODE_ENV production

RUN addgroup --system --gid 1001 nodejs
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@neshca/cache-handler": "^1.9.0",
"@neshca/json-replacer-reviver": "^1.1.3",
"@next/third-parties": "^14.2.20",
"@prisma/client": "^5.22.0",
"@prisma/client": "^6.1.0-dev.14",
"@reduxjs/toolkit": "^2.2.4",
"@tippyjs/react": "^4.2.6",
"async-throttle": "^1.1.0",
Expand Down
3 changes: 2 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ datasource db {
}

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x"]
}

model Participant {
Expand Down

0 comments on commit 8e7dc79

Please sign in to comment.