Post
Topic
Board Development & Technical Discussion
Re: How to connect docker container to bitcoin node?
by
Exchangman
on 14/10/2022, 11:33:21 UTC
You should use the internal IP on the Python container, not localhost.

Code:
connection_url="http://%s:%s@host.docker.internal:8332/wallet/testwallet"
credentials=('testuser','testpassword')
rpc_connection = AuthServiceProxy(connection_url % credentials)
rpc_connection.getnewaddress()


If it still not works, try refer to https://www.howtogeek.com/devops/how-to-connect-to-localhost-within-a-docker-container/

internal ip like 127.0.01? but that will connect to docker localhost network not the server localhost?