I have 2 docker images 1) for couchdb and 2) a web application. The web application couldnt able to talk to the couchdb which is running on the same machine.
When I access couchdb directly it is working http://127.0.0.1:5984/_utils/#database/ http://0.0.0.0:5984/_utils/#database/
What am I missing any pointers?
| Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:5984 [localhost/127.0.0.1] failed: Connection refused (Connection refused)
hashgraph_1 | at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
hashgraph_1 | at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
hashgraph_1 | at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
hashgraph_1 | at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
hashgraph_1 | at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
hashgraph_1 | at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
hashgraph_1 | at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
hashgraph_1 | at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
hashgraph_1 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
hashgraph_1 | at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
my docker compose file
version: "3"
services:
hashgraph:
build: "./"
depends_on:
- couchdb
deploy:
replicas: 1
restart_policy:
condition: always
ports:
- "51200-51299:51200-51299"
couchdb:
image: couchdb:2.1
ports:
- "5984:5984"
deploy:
replicas: 1
restart_policy:
condition: always
Output of docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cc7e37cd6260 hashgraphexperiments_hashgraph "java -jar swirlds.j…" About a minute ago Up About a minute 50200-50299/tcp, 0.0.0.0:51200-51299->51200-51299/tcp hashgraphexperiments_hashgraph_1
9f4767b36aea couchdb:2.1 "tini -- /docker-ent…" 2 hours ago Up About a minute 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp hashgraphexperiments_couchdb_1