Thanks to @DavidMaze's comment, I started experimenting with using localhost
instead of the name of the React application container, since apparently React runs in the browser. In my case the URL for each container looks like this: http://containerName:port
and I use that URL when requests are made between them (since all these containers are in the same Docker network), but whenever I want to make a request from the React container, I use http//localhost:port
.
http://webapp:3000
3000
Feel free to edit to add more useful information if necessary.