I guess the error occurs because the Docker Compose configuration mounts anonymous volumes (/app/node_modules and /app/.next), which override the container's internal directories.
/app/node_modules
/app/.next