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.
Note: I am running docker and NodeJs Service on Windows 10.
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?
My guess is docker is its own network, so it cannot connect to LocalHost:3005. To work around this issue I changed the network of the docker container to host. However, I have come to know that this feature is not supported in windows. So what do I do now ?
Below is the reference to the question I posted on Stack Overflow:-
For bridged and overlay networks, localhost is local to the container. If the process queriying localhost:3005 is inside the container then there is not problem.
if localhost:3005 is hard coded in a config file, you can introduce an env variable that holds the external url http://192.168.99.100:8080 and sets it on container start in the configuration file beeing responsible.This would at least allow to modify the hard coded address when the container is created. Though, a dynamic approach is prefered, where you get the information about the host and port from the request url itself.
If neither modifiying the configuration on container start or modifiying the app is an option, you might introduce a reverse proxy that rewrites the url.
I am not sure I understand you. You say Local Host is accessible from Docker. I see a message on the Docker Client Localhost connection refused. Why would I get this error if Localhost is accessible.
I am not sure I understood the explanation you gave about having variables. Can you give an example based on my explanation above.
I did run the container with docker run -d -p 8080:8080 -it patelsan/presentations-pdf-toolkit:1.0.1 and there is not one error in the logs. So it must be something caused by configuration or the way you use it!!
What does that mean? Did you configure something that the container calls 127.0.0.1:3005, or is this the default behavior of the image?
Update: it is not…
This thread is a classical case of: i just tell you what I think is important without providing the full picture.
Where did you find the documentation of this image?
What do you expect this image to do?
What makes you think this is image is not a work in progress state?
how do you expect that it needs to be configured?