fix(docker): openssl in Alpine, binaryTargets for Prisma, IPv4 healthcheck, start_period for migration delay

This commit is contained in:
Experiments DB Dev
2026-04-15 13:43:20 -04:00
parent b03566e658
commit 80fb1c6e27
3 changed files with 15 additions and 9 deletions
+8 -3
View File
@@ -1,4 +1,6 @@
FROM node:20-alpine AS base
# Prisma migration engine requires OpenSSL
RUN apk add --no-cache openssl
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
@@ -9,9 +11,12 @@ COPY . .
CMD ["npm", "run", "dev"]
FROM base AS prod
# Install prisma CLI for migrate deploy at runtime
RUN npm install prisma --save-dev
COPY . .
# Generate Prisma client in the production image
# Generate Prisma Client
RUN npx prisma generate
# Run as non-root user
# Fix ownership so the node user can write engine cache
RUN chown -R node:node /app
USER node
CMD ["node", "src/index.js"]
CMD ["/bin/sh", "/app/docker-entrypoint.sh"]
+2 -1
View File
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
}
datasource db {