If my application is running with docker compose how can I access localhost of within that application

I have a django application which runs through docker compose on my local system on localhost:80. I have another application which runs at localhost:3000. I want to access http://localhost:3000 within the django application. While I try to access this I get the below error:

ConnectionError at / HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with URL: /render (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1a03d7a610>: Failed to establish a new connection: [Errno 111] Connection refused'))

Back to Top