title: Connecting Redis localhost from Docker
body: <p>I have a Node.js application where I use Redis, I am trying to connect the Docker container and the locally running Redis.</p>
  <p>Tried solutions:</p>
  <ol>
  <li><p>vim /usr/local/etc/redis.conf</p>
  <p>Updated</p>
  <pre><code>bind 127.0.0.1
  </code></pre>
  <p>To</p>
  <pre><code>bind 0.0.0.0
  </code></pre>
  <p>Stopped the redis and start it again and tried running the docker</p>
  </li>
  <li><p>With the above thing tried running <code>docker run -p 4000:8080 -p 6379:6379 -t node-app</code></p>
  </li>
  </ol>
  <p>Both above didn't worked getting the below error</p>
  <pre><code>Error: Redis connection to localhost:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
  </code></pre>
  <p>Update: I am checking it on Mac.</p>