How to start celery worker in docker with supervisord?

Trying to run two containers in the first working broker for celery, the second will be django, uwsgi, celery.
Generally hotels to run celery in a separate container, using the official way, it is not clear how will the structure of such an application. Well, okay. Trying to start dev server of Django and the worker using supervisord. Django starts, supervisor displays an error:
django | 2016-05-31 14:23:43,685 INFO spawned: 'celery' with pid 28
django | 2016-05-31 14:23:44,198 INFO exited: celery (exit status 1; not expected)
django | 2016-05-31 14:23:47,212 INFO spawned: 'celery' with pid 32
django | 2016-05-31 14:23:47,760 INFO exited: celery (exit status 1; not expected)
django | 2016-05-31 14:23:48,765 INFO gave up: celery entered FATAL state, too many start retries too quickly

version: '2'


 container_name: rabbitmq
 image: rabbitmq
 - "5672:5672"
 - "15672:15672"

 container_name: django
 build: ../proj/
 - /home/user/proj
 command: supervisord -c supervisord.conf
 - "8000:8000"
 - rabbitmq
 - "rabbitmq"

FROM ubuntu:16.04

RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y python3 python3-pip build-essential python3-dev supervisor

COPY . /home/user/proj
WORKDIR /home/user/proj

RUN pip3 install-r requirements.txt \
 && python3 collectstatic --no-input \
 && python3 makemigrations \
 && python3 migrate


command=python3 runserver

command=celery worker -A proj --loglevel=info

From the log container can be seen that rabbitmq will start later, despite the key depends_on. In General, what to do? Configs as soon as did not twist, the error is always the same.
July 9th 19 at 10:11
1 answer
July 9th 19 at 10:13
must first check in cange whether rebbit, ie, as in my example, but I'm waiting for the start of the DB, you will have to wait for the start rabbitmq

depends_on guarantees the start of the container, but this does not mean that the quick start process earlier than in a different container
Have used wait-for-it, the proposed site of Docker. The script waited for the availability rabbitmq:5672 and celery made several attempts to start and flew again with the same error - Wendell.Weber37 commented on July 9th 19 at 10:16

Find more questions by tags CeleryDjangoDockerSupervisor