Ipfshttpclient (python) connection error

I have ipfshttpclient version 0.4.12 and ipfs demon version 0.4.23. Ipfs and python are in containers:
ipfs:
image: ipfs/go-ipfs:v0.4.23
ports:
- “4001:4001”
- “5001:5001”
- “8080:8080”
networks:
- knox-net
networks:
knox-net:
driver: bridge

I try connect method: client = ipfshttpclient.connect("/dns/ipfs/tcp/5001")
but get error

Your API is not listening on a public interface. Change to 0.0.0.0 in the config.