docker-compose


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.

Related Links

Docker-compose and load balancing
Run arguments in Docker Compose
Docker compose file config
Systemd “No such file or directory” itself during “docker-compose up”
Docker compose yml static IP addressing
compose extend file results in a validation error
hubot rocketchat adapter does not work
Docker compose lables constraint:node not work
is it possible to generate a random mysql password with dockercompose
Networking Docker Compose
How to change the config file for Riak TS when using Docker
Django Docker-compose machine does not start web server
How should docker-compose jobs discover etcd?
docker compose adding nodes dynamically to nginx frontend
Docker Swarm - dependencies definition
docker-compose volume not mounted

Categories

HOME
gcc
ns2
qemu
pelican
aix
arguments
crash
clip-path
yacc
wkhtmltopdf
drush
logstash-configuration
vivado-hls
ibatis
md2
django-rest-auth
project-structure
hl7-fhir
xna
rndis
google-drive-android-api
waterfall
oracle10g
expressionengine
mex
hierarchical-data
large-files
resx
spring-data-gemfire
slim-lang
log4net-configuration
jsonapi-resources
hippocms
oracle-bpm-suite
word-wrap
area
latency
server-side-swift
autodesk-data-management
compiler-warnings
spring-webflow-2
anonymous-function
nao-robot
monaca
wink
node-java
intermediate-language
racket-student-languages
angularfire
kik
avaudiorecorder
archiva
abstract
music-player
fadein
sqldataadapter
personality-insights
traminer
cyberduck
perfect-scrollbar
data-quality-services
alpha-beta-pruning
aiff
fedena
tigase
sat4j
dotcmis
parallel-port
triplestore
cs193p
ant-contrib
sendy
git-subtree
db2-connect
grunt-contrib-imagemin
xrandr
asp.net-4.0
google-checkout
windows-scheduler
junit-rule
report-viewer2010
teamsystem
mysql-connector
fileoutputstream
mcpd
cherokee
session-hijacking
zipstream
n2
mass-emails
chromebug
database-agnostic
datadude
time-management
djangoappengine
ironpython-studio

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App