How to start celery worker in docker with supervisord?

Hello!
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

docker-compose.yml
version: '2'

services:

rabbitmq:
 container_name: rabbitmq
 image: rabbitmq
environment:
 - RABBITMQ_DEFAULT_USER=guest
 - RABBITMQ_DEFAULT_PASS=guest
ports:
 - "5672:5672"
 - "15672:15672"

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


Dockerfile
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 manage.py collectstatic --no-input \
 && python3 manage.py makemigrations \
 && python3 manage.py migrate


supervisord.conf
[supervisord]
nodaemon=true

[program:django]
command=python3 manage.py runserver 0.0.0.0:8000

[program:celery]
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
https://github.com/Gasoid/docker_django_psql_and_c...

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