title: can't connect to redis through node app, both in dockers
body: <p>I'm trying to connect my app to redis, but i get:</p>
  
  <p><code>[ioredis] Unhandled error event: Error: connect ECONNREFUSED  127.0.0.1:6379</code></p>
  
  <p>when i do:</p>
  
  <p><code>docker exec -it ed02b7e19810 ping test_redis_1</code>
  i've received all packets.</p>
  
  <p>also the redis container declares:</p>
  
  <p><code>* Running mode=standalone, port=6379</code> </p>
  
  <p><code>* Ready to accept connections</code></p>
  
  <p>( i get the WARNINGS but i don't think its related:</p>
  
  <p><code>Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf</code></p>
  
  <p><code>WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128</code></p>
  
  <p>this is my docker-compose.yaml:</p>
  
  <pre><code>version: '3'
  
  services:
    test-service:
        build: .
        volumes:
          - ./:/usr/test-service/
        ports:
          - 5001:3000
        depends_on:
          - redis
    redis:
      image: "redis:alpine"
  </code></pre>
  
  <p>DockerFile</p>
  
  <pre><code> FROM node:8.11.2-alpine
  
   WORKDIR /usr/test-service/
  
   COPY . /usr/test-service/
  
   RUN yarn install
  
   EXPOSE 3000
  
   CMD ["yarn", "run", "start"]
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>const Redis = require('ioredis');
  const redis = new Redis();
  
  redis.set('foo', 'bar');
  redis.get('foo').then(function (result) {
      console.log(result);
  });
  </code></pre>
  
  <p>i've also tried with <code>redis</code> package but still can't connect:</p>
  
  <pre><code> var redis = require("redis"),
       client = redis.createClient();
  
   client.on("error", function (err) {
       console.log("Error " + err);
   });
  </code></pre>
  
  <p>getting:</p>
  
  <pre><code> Error Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
  </code></pre>