title: Celery workers unable to connect to redis on docker instances
body: <p>I have a dockerized setup running a Django app within which I use Celery tasks. Celery uses Redis as the broker.</p>
  
  <p><strong>Versioning:</strong></p>
  
  <ul>
  <li>Docker version 17.09.0-ce, build afdb6d4</li>
  <li>docker-compose version 1.15.0, build e12f3b9</li>
  <li>Django==1.9.6</li>
  <li>django-celery-beat==1.0.1</li>
  <li>celery==4.1.0</li>
  <li>celery[redis]</li>
  <li>redis==2.10.5</li>
  </ul>
  
  <p><strong>Problem:</strong></p>
  
  <p>My celery workers appear to be unable to connect to the redis container located at localhost:6379. I am able to telnet into the redis server on the specified port. I am able to verify redis-server is running on the container.</p>
  
  <p>When I manually connect to the Celery docker instance and attempt to create a worker using the command <code>celery -A backend worker -l info</code> I get the notice:</p>
  
  <p><code>[2017-11-13 18:07:50,937: ERROR/MainProcess] consumer: Cannot connect to redis://localhost:6379/0: Error 99 connecting to localhost:6379. Cannot assign requested address..
  Trying again in 4.00 seconds...</code></p>
  
  <p><strong>Notes:</strong></p>
  
  <p>I am able to telnet in to the redis container on port 6379. On the redis container, redis-server is running. </p>
  
  <p>Is there anything else that I'm missing? I've gone pretty far down the rabbit hole, but feel like I'm missing something really simple.</p>
  
  <p><strong>DOCKER CONFIG FILES:</strong></p>
  
  <p>docker-compose.common.yml <a href="http://paste.ubuntu.com/25956140/" rel="noreferrer">here</a><br>
  docker-compose.dev.yml <a href="http://paste.ubuntu.com/25956144/" rel="noreferrer">here</a></p>