0

so I am building a web app with react in the frontend and node.js in the backend, to run my API. Because both services were running on the same address, I specified "proxy": "http://localhost:8081" in my package.json and everything worked fine. Now I want to use Docker to manage the deployment of my app and I packaged, both my apps and started them with docker-compose, but for some reason my frontend is not able to send the requests correct. The console keeps saying: " Proxy error: Could not proxy request /api/tags/ from localhost to http://localhost:8081"

What is the best solution to connect my frontend with my backend in a Docker environment?

Björn Rave
  • 119
  • 1
  • 16
  • Take a look at [this](https://docs.docker.com/compose/networking/) – Jack Gore Jul 05 '18 at 15:21
  • You need to use `http://:8081` in your `package.json` – Tarun Lalwani Jul 05 '18 at 15:41
  • Possible duplicate of [Can (or should) 2 docker containers interact with each other via localhost?](https://stackoverflow.com/questions/45551966/can-or-should-2-docker-containers-interact-with-each-other-via-localhost) – David Maze Jul 05 '18 at 23:15

0 Answers0