correction du dockerfile pour deploiement
All checks were successful
Build and Push App / build (push) Successful in 1m51s
All checks were successful
Build and Push App / build (push) Successful in 1m51s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Base image
|
||||
FROM node:20-alpine AS base
|
||||
FROM node:22-alpine AS base
|
||||
RUN apk add --no-cache libc6-compat openssl
|
||||
|
||||
# Install dependencies only when needed
|
||||
@@ -33,6 +33,8 @@ RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/prisma ./node_modules/prisma
|
||||
|
||||
# Set the correct permission for prerender cache
|
||||
RUN mkdir .next
|
||||
@@ -50,4 +52,5 @@ ENV PORT 3001
|
||||
ENV HOSTNAME "0.0.0.0"
|
||||
|
||||
# Run migrations and start the server
|
||||
CMD ["sh", "-c", "npx prisma db push && node server.js"]
|
||||
# Utilise le binaire local pour éviter que npx tente de le télécharger
|
||||
CMD ["sh", "-c", "./node_modules/.bin/prisma db push --schema=prisma/schema.prisma --accept-data-loss && node server.js"]
|
||||
|
||||
Reference in New Issue
Block a user