while both containers are in the same ECS task, they still need to communicate using their internal DNS names, not localhost or the ALB DNS.
So,
In ECS, containers in the same task can communicate via their internal DNS. Set the NEXT_PUBLIC_NODE_API_URL
in your Next.js container to http://nodejs-app:8080
.