URL for cloudant on docker compose
Using the docker compose, I'm trying to get my app to call the cloudant URL with the following values, but always get connection refused: http://admin:pass#0.0.0.0:8080 http://admin:pass#cloudant:8080 But if I go to http://0.0.0.0:8080/dashboard.html, I can access the cloudant web console. Here is my compose file (referencing the sample in Running Cloudant as docker container with docker compose) version: '2.1' services: app: build: app/ links: - cloudant cloudant: image: ibmcom/cloudant-developer:latest container_name: cloudant-testdb ports: - "8080:80" expose: - "80" volumes: - cloudant:/srv mem_limit: 256M restart: always privileged: true network_mode: bridge volumes: cloudant:
Here is how I got this to work: Specify the hostname for the cloudant container in your docker-compose file like so: restart: always hostname: cloudant privileged: true When communicating between containers you use the ports exposed by the services in the container, not the ports that are defined in the mapping. In this case you use the port exposed by Cloudant which is 80. So, your URL should look like this: http://admin:pass#cloudant Set the network_mode value to bridge in the app container. Here is a working example: https://github.com/markwatsonatx/tutorial-cloudant-nodejs-intro Also, be sure to accept the license in Cloudant and initialize the database. You may need to restart docker-compose after doing so.
Name an image built from running a docker-compose file
Race conditions after changing names in docker-compose.yml
Docker compose - image not found
How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?