I think this is a classic docker mistake. a localhost url inside an container references the localhost of the container, not of your machine.
so instead of filling your ${process.env.NEXT_PUBLIC_API_BASE_URL} with "localhost" it should be
"host.docker.internal" which references to the localhost of the machine thats currently running docker.