What shall I give the ip adress of redis container to which tomcat will connect through source code Docker volume

I am a beginner in docker.
My source code has a properties file inside xyz volume where I have to mention redis ip address and password. Here tomcat is unable to connect to redis
This is my docker-compose.yml

version: "2"

services:
    tomcat:
      container_name: tomcat
      build: ./tomcat
      ports:
       - "8080:8080"
      env_file:
       - ./tomcat/tomcat.env
      networks:
       - srikant-network
      environment:
       - COMPOSE_HTTP_TIMEOUT=200
      volumes:
       - /opt/xyz:/opt/xyz
      depends_on:
       - redis
       - mysql
       - elasticsearch

    redis:
      container_name: redis
      build: ./redis
      ports:
       - "6379"
      environment:
         requirepass: password
      networks:
       - srikant-network

    elasticsearch:
      container_name: elasticsearch
      build: ./elasticsearch
      ports:
       - "9300:9300"
       - "9200:9200"
      networks:
       - srikant-network
    mysql:
      container_name: mysql
      build: ./mysql
      ports:
       - "3306:3306"
      networks:
       - srikant-network
      environment:
       - MYSQL_ROOT_PASSWORD=password
       - MYSQL_HOST=localhost
networks:
    srikant-network:
      driver: bridge

This is version of docker and docker-compose:

  • how to install glib2 package in docker
  • How to run docker images (nodejs server) without exiting
  • Use: docker build -t myapp . cannot get image successfully
  • Secrets with containerized single-node kubernetes cluster
  • Cannot find Jupyter Notebook server on port 8888 (Windows 10)
  • How to install ffmpeg for ubuntu using command line?
  • [root@sqlnode1 ha]# docker version
    Client:
     Version:         1.12.6
     API version:     1.24
     Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
     Go version:      go1.7.4
     Git commit:      1398f24/1.12.6
     Built:           Fri May 26 17:28:18 2017
     OS/Arch:         linux/amd64
    
    Server:
     Version:         1.12.6
     API version:     1.24
     Package version: docker-1.12.6-28.git1398f24.el7.centos.x86_64
     Go version:      go1.7.4
     Git commit:      1398f24/1.12.6
     Built:           Fri May 26 17:28:18 2017
     OS/Arch:         linux/amd64
    
    
    [root@sqlnode1 ha]# docker-compose version
    docker-compose version 1.13.0, build 1719ceb
    docker-py version: 2.3.0
    CPython version: 2.7.5
    OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
    

    This is the Dockerfile of redis

    FROM ubuntu:14.04
    
    RUN apt-get update && apt-get install -y redis-server
    
    EXPOSE 6379
    ENV requirepass redis-password
    
    ENTRYPOINT ["/usr/bin/redis-server"]
    

  • Can not connect to postgresql which is inside of a docker container
  • Can't push docker image to gcloud
  • Cannot get more than one port to be exposed with docker [duplicate]
  • Vue.js Webpack Template in a Docker Container: How do I add Webpack-Dev-Server --watch-poll flag?
  • What is relationship and difference between Docker Volume and Volume Container
  • Can't execute boot2docker command on TeamCity command line build step
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.