Answer the question
In order to leave comments, you need to log in
How to run celery worker in docker with supervisord?
Hello!
I'm trying to run two containers, the broker for celery works in the first one, the second one will have django, uwsgi, celery.
In general, I would like to run celery in a separate container using the official image, it is not clear how the structure of such an application will look like. Anyway. I'm trying to start a django dev server and a worker using supervisord. Django starts, supervisor throws 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'
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"
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]
nodaemon=true
[program:django]
command=python3 manage.py runserver 0.0.0.0:8000
[program:celery]
command=celery worker -A proj --loglevel=info
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question