I have a docker container basically running Athena Tool Kit for PDF generation. The service in docker in turn calls a NodeJs Application at this URL: - http://localhost:3005.
However I see a message on Docker Console:-
[GIN] 2019/08/23 - 22:24:46 | 500 | 1.850464ms | 192.168.99.1 | GET /convert
Error #01: Get http://localhost:3005/presentations/d0161fed-0ade-40a5-8dff-26696e553e96?id=d0161fed-0ade-40a5-8dff-26696e553e96&type=box-upload¶ms=: dial tcp 127.0.0.1:3005: connect: connection refused
captured errors:
Error #01: Get http://localhost:3005/presentations/d0161fed-0ade-40a5-8dff-26696e553e96?id=d0161fed-0ade-40a5-8dff-26696e553e96&type=box-upload¶ms=: dial tcp 127.0.0.1:3005: connect: connection refused.
The Docker Service runs locally at http://192.168.99.100:8080. From this address it is trying to call 127.0.0.1:3005. When it does I get the error above.
I am guessing this must be allowing access to local host from a different IP.
Please let me know what needs to be done.
as I can see, you are running to applications, the first one is
patelsan/presentations-pdf-toolkit
with a docker container and the second one is a nodejs application within your host.otherwise as mentioned in Docker doc Docker network host :
I have 3 solutions for both local and prod environments:
as a local env solution, you can assign the
patelsan/presentations-pdf-toolkit
container to the defaulthost
network in the docker, in this way both applications can communicate with each other:you can use weave net service to create a virtual network.
NP:
If your host is Windows or Mac I suggest you containerize the nodejs application as well, with that you can create a new network and your 2 containers can communicate with that network.