Add database migration command to entrypoint script: Include 'pnpm dlx prisma db push' to ensure database schema is updated during container startup, enhancing deployment reliability.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 12s

This commit is contained in:
Julien Froidefond
2025-12-16 17:01:53 +01:00
parent 5eddf36121
commit 7c0b3bc848

View File

@@ -67,6 +67,7 @@ RUN echo '#!/bin/sh' > /app/entrypoint.sh && \
echo 'mkdir -p /app/public/uploads' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads' >> /app/entrypoint.sh && \
echo 'mkdir -p /app/public/uploads/backgrounds' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads/backgrounds' >> /app/entrypoint.sh && \
echo 'pnpm dlx prisma migrate deploy || true' >> /app/entrypoint.sh && \ echo 'pnpm dlx prisma migrate deploy || true' >> /app/entrypoint.sh && \
echo 'pnpm dlx prisma db push || true' >> /app/entrypoint.sh && \
echo 'exec pnpm start' >> /app/entrypoint.sh && \ echo 'exec pnpm start' >> /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh && \ chmod +x /app/entrypoint.sh && \
chown nextjs:nodejs /app/entrypoint.sh chown nextjs:nodejs /app/entrypoint.sh