Docker compose service discovery via consul

Hi ,

I am trying to bring the python app up and connecting to redis database at backend but not able to discover the service so would like to know how i can make service discovered under consul because when i am running below docker compose it is unable to detect the service?? also i tried the template & redis directory that contains json file for each service discovery but still dns name resolution is not working. I do not want services feature of docker compose to put in docker compose file.

consul:
command: -server -bootstrap
image: progrium/consul:latest
ports:
- 8400:8400 # rpc/rest
- 8500:8500 # ui
- 8600:53/udp # dns
- 0.0.0.0:53:53/udp # dns

registrator:
command: -ip=0.0.0.0 consul://consul:8500
image: gliderlabs/registrator:latest
volumes:
- "/var/run/docker.sock:/tmp/docker.sock"
links:
- consul

web:
build: .
command: python app.py
ports:
- "8080:5000"
volumes:
- .:/code
volumes:
- ./templates/web.json:/etc/consul-templates
links:
- consul
redis:
image: redis
volumes:

  • ./redis/redis.json:/etc/consul-templates
    links:
  • consul