Can't open bucket when using dockerized couchbase (docker-compose)

I followed this blog entry https://blog.couchbase.com/couchbase-using-docker-compose/ to set up my local couchbase instance, however when I run my local java service to connect to my bucket, the connection times out.
I can connect to the cluster using localhost/127.0.0.1 but when my java client connects to “/pools/nodes”, the “couchApiBase”:“http://172.18.0.2:8092/” points the client to attempt to connect to that IP address which is not accessible from outside the container. is there something I’m missing from my docker-compose file to tunnel this IP address?

Even I am having a similar kind of issue, have already dig the whole of internet but no solutions seem to work out,
Please anyone can help me out? I am really very much pissed already.

Thanks in advance Regards.