Hotfix Docker file 'bcrypt' error

This commit is contained in:
headlessdev
2025-04-16 14:55:09 +02:00
committed by GitHub
parent 676354f53c
commit f5c835b5d9

View File

@@ -6,9 +6,13 @@ WORKDIR /app
COPY package.json package-lock.json* ./
COPY ./prisma ./prisma
# Install all dependencies (including devDependencies)
RUN npm install
# Generate Prisma client
RUN npx prisma generate
# Build the application
COPY . .
RUN npm run build
@@ -19,13 +23,16 @@ WORKDIR /app
ENV NODE_ENV production
# Install production dependencies INCLUDING prisma
# Copy package files
COPY package.json package-lock.json* ./
RUN npm install --production --ignore-scripts
# Copy needed Prisma files
COPY --from=builder /app/node_modules/.prisma /app/node_modules/.prisma
COPY --from=builder /app/node_modules/@prisma /app/node_modules/@prisma
# Copy node_modules from builder
COPY --from=builder /app/node_modules ./node_modules
# Remove dev dependencies
RUN npm prune --production
# Copy Prisma files
COPY --from=builder /app/prisma ./prisma
# Copy built application
@@ -36,5 +43,5 @@ COPY --from=builder /app/next.config.js* ./
EXPOSE 3000
# Run migrations first, then start app
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]
# Run migrations and start
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]