fix: Prisma OpenSSL engine binary detection on Alpine
Deploy Canina / deploy (push) Successful in 34s
Deploy Canina / deploy (push) Successful in 34s
- Set PRISMA_SCHEMA_ENGINE_BINARY to 3.0.x binary path - Set PRISMA_QUERY_ENGINE_LIBRARY to 3.0.x library path - node:20-alpine has libssl.so.3 but no openssl CLI binary - Prisma detection fails silently, defaults to 1.1.x engines - Explicit paths bypass detection and use correct binaries - Remove apk add openssl (not needed, causes build failure without VPN) - backend Dockerfile: use PRISMA_CLI_BINARY_TARGETS to generate correct client
This commit is contained in:
1 parent
501addc909
commit
431e2b547d
3 files changed
+7
-3
No files matched your search
+3
-3
@@ -1,13 +1,12 @@
|
||||
FROM node:20-alpine AS builder
|
||||
RUN apk add --no-cache openssl 2>/dev/null || true
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --prefer-offline --no-audit
|
||||
RUN npm config set registry http://registry.parsaaghayi.ir/repository/npm-proxy/ && npm ci
|
||||
COPY . .
|
||||
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
||||
RUN npx prisma generate && npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
RUN apk add --no-cache openssl 2>/dev/null || true
|
||||
RUN mkdir -p /app/uploads && chown node:node /app/uploads
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/package*.json ./
|
||||
@@ -16,6 +15,7 @@ COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/prisma/scientificTerms.ts ./prisma/scientificTerms.ts
|
||||
RUN chown -R node:node /app
|
||||
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
||||
EXPOSE 3000
|
||||
USER node
|
||||
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"]
|
||||
Reference in new issue
Block a user