title: Django cant connect to redis in docker
body: <p>Sorry for my english. I have project in django, In my project i want use celery for background task and now i need set settings in docker for this library. This my docker file:</p>
  
  <pre><code>FROM python:3
  
  MAINTAINER Alex2
  
  RUN apt-get update
  
  # Install wkhtmltopdf
  RUN curl -L#o wk.tar.xz https://downloads.wkhtmltopdf.org/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
      &amp;&amp; tar xf wk.tar.xz \
      &amp;&amp; cp wkhtmltox/bin/wkhtmltopdf /usr/bin \
      &amp;&amp; cp wkhtmltox/bin/wkhtmltoimage /usr/bin \
      &amp;&amp; rm wk.tar.xz \
      &amp;&amp; rm -r wkhtmltox
  
  RUN apt-get install -y cron
  
  # for celery
  ENV APP_USER user
  ENV APP_ROOT /src
  
  RUN groupadd -r ${APP_USER} \
      &amp;&amp; useradd -r -m \
      --home-dir ${APP_ROOT} \
      -s /usr/sbin/nologin \
      -g ${APP_USER} ${APP_USER}
  
  
  # create directory for application source code
  RUN mkdir -p /usr/django/app
  
  COPY requirements.txt /usr/django/app/
  
  WORKDIR /usr/django/app
  
  RUN pip install -r requirements.txt
  </code></pre>
  
  <p>this my <code>docker-compose.dev</code></p>
  
  <pre><code>version: '2.0'
  services:
    web:
      build: .
      container_name: api_dev
      image: img/api_dev
      volumes:
        - .:/usr/django/app/
        - ./static:/static
      expose:
        - "8001"
      env_file: env/dev.env
      command: bash django_run.sh
  
    nginx:
      build: nginx
      container_name: ng_dev
      image: img/ng_dev
      ports:
        - "8001:8001"
      volumes:
        - ./nginx/dev_api.conf:/etc/nginx/conf.d/api.conf
        - .:/usr/django/app/
        - ./static:/static
      depends_on:
        - web
      links:
        - web:web
  
    db:
      image: postgres:latest
      container_name: pq01
      ports:
       - "5432:5432"
  
    redis:
      image: redis:latest
      container_name: rd01
      command: redis-server
      ports:
       - "8004:8004"
  
    celery:
      build: .
      container_name: cl01
      command: celery worker --app=myapp.celery
      volumes:
        - .:/usr/django/app/
      links:
        - db
        - redis
  </code></pre>
  
  <p>and i have this error:</p>
  
  <pre><code>cl01      | User information: uid=0 euid=0 gid=0 egid=0
  cl01      | 
  cl01      |   uid=uid, euid=euid, gid=gid, egid=egid,
  cl01      | [2018-07-31 16:40:00,207: ERROR/MainProcess] consumer: Cannot connect to redis://redis:8004/0: Error 111 connecting to redis:8004. Connection refused..
  cl01      | Trying again in 2.00 seconds...
  cl01      | 
  cl01      | [2018-07-31 16:40:02,211: ERROR/MainProcess] consumer: Cannot connect to redis://redis:8004/0: Error 111 connecting to redis:8004. Connection refused..
  cl01      | Trying again in 4.00 seconds...
  cl01      | 
  cl01      | [2018-07-31 16:40:06,217: ERROR/MainProcess] consumer: Cannot connect to redis://redis:8004/0: Error 111 connecting to redis:8004. Connection refused..
  cl01      | Trying again in 6.00 seconds...
  </code></pre>
  
  <p>i cant understand why it not connect. My settings file project</p>
  
  <pre><code>CELERY_BROKER_URL = 'redis://redis:8004/0'
  CELERY_RESULT_BACKEND = 'redis://redis:8004/0'
  </code></pre>
  
  <p>Everything looks like good, but mayby in some file i dont add some settings. Please help me solve this problem </p>