Solving prisma error running on docker linux-musl

When running prisma inside a docker on my mac m1, it shows those error, here is how I solve prisma Error: Query engine library for current platform linux-musl

In you schema.prisma file add new binaryTargets named linux-musl

generator client {
  provider = "prisma-client-js"
  binaryTargets = ["native", "linux-musl"]

After that, run npx prisma generate or refresh your docker, with

docker-compose down
docker-compose up -d --build

[Update] You might need to update your prisma inside the docker

docker-compose -f exec app npx prisma generate

I did it, when I got this error

Your schema.prisma could not be found, and we detected that you are using Next.js.


PrismaClientInitializationError: Query engine library for current platform