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:

  • Docker push to artifactory gives a 403
  • Modifying and rebuilding a Docker image
  • Jenkins and SonarQube in same dockerfile
  • docker-compose fails when bringing up vagrant box
  • I need to remove folder and any descendents
  • Unable to access Asp.Net vNext application hosted in Docker Container in Windows Server 2016 Azure VM [Solved]
  • [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"]
    

  • how to find out account or usage infos for a docker image?
  • Node.JS proxy with Nginx and Docker
  • How many WordPress instances can i run on Google Compute engine in a single google cloud platform project.
  • Copy log files from Docker container to host after CMD is run
  • Assigning Public IP to SQL Server Docker Image
  • Running MPD server with Mopidy docker container, how do I play on Mac?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.