title: connection refused when trying to connect redis using docker compose file
body: <p>I have a problem trying to connect to redis using <a href="https://github.com/go-redis/redis" rel="nofollow noreferrer">redis-golang</a> driver.
  this is my <code>docker-compose.yml</code> file : </p>
  
  <pre><code>version: "3"
  
  services:
    driver:
      build: ./API-Golang
      command: go run app.go
      volumes:
       - ./API-Golang:/app
      ports:
        - "8080:8080"
      depends_on:
        - db
        - redis
      links :
        - redis
        - db
    redis:
      image: redis
      container_name: redis
      ports: ["6379:6379"]
    db:
      image: mongo:3.4.2
      container_name: mongodb
      ports : ["27017:27017"]
  </code></pre>
  
  <p>and this the code where I try to connect to redis (API-Golang/database/allSystem.go):</p>
  
  <pre><code>redisConn := RedisHost{
      Address:  "localhost:6379",
      Password: "",
      DB:       0,
  }
  
  redisConnection, err := redisConn.Connect()
  if err != nil {
      panic(err)
  }
  </code></pre>
  
  <p>I have tried to change <code>localhost</code> to <code>redis</code> for the host but still it doesn't work. Here is the error :</p>
  
  <pre><code>driver_1  | panic: dial tcp [::1]:6379: getsockopt: connection refused
  driver_1  | 
  driver_1  | goroutine 1 [running]:
  driver_1  | github.com/Gujarats/API-Golang/database.SystemConnection(0x48)
  driver_1  |     /go/src/github.com/Gujarats/API-Golang/database/allSystem.go:32 +0x3d3
  driver_1  | main.main()
  driver_1  |     /go/src/github.com/Gujarats/API-Golang/app.go:24 +0x34
  driver_1  | exit status 2
  </code></pre>
  
  <p>Any idea what's wrong?</p>
  
  <p><a href="https://github.com/Gujarats/Go-docker" rel="nofollow noreferrer">Source Code</a></p>