I am using tutum to deploy an application that involves web and db conponents. Here are the relevant parts of the tutum.yml file.
db:
image: 'postgres:latest'
ports:
- '5432:5432'
restart: always
volumes_from:
- data
web:
image: 'rchamarthi/djangoweb:latest'
command: 'bash -c ''python manage.py makemigrations && python manage.py migrate && /usr/local/bin/gunicorn django_project.wsgi:application -w 2 -b :8000'''
expose:
- '8000'
links:
- db
restart: always
volumes:
- /usr/src/app/static
working_dir: /usr/src/app/
Since web has a link to DB, iam expecting "db" host details to be added in the web container's /etc/hosts file, but I don't see anything.
In the web container
# cat /etc/hosts
172.17.0.50 web-1
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
In the DB container
# cat /etc/hosts
172.17.0.49 db-1
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
As a result, db connections from the web container are failing.