title: Gracefully stopping celery in docker container
body: <p>I have celery running in a docker container processing tasks from rabbitmq. I am trying to stop and remove the celery container, while allowing the current running tasks to complete. The docs suggest that sending the TERM or INT signals to the main process should warm shutdown celery, although I am finding that the child processes are just being killed.</p>
  
  <p>When I send TERM the running processes it throws:</p>
  
  <p><code>WorkerLostError('Worker exited prematurely: signal 15 (SIGTERM).',)</code></p>
  
  <p>When I send INT the running process just exits with no error, although it too doesn't allow the tasks to finish as the docs suggest.</p>
  
  <p>I am starting the docker container with the command:
  <code>su -m celery_user -c "python manage.py celery worker -Q queue-name"</code></p>
  
  <p>Any thoughts on why this might be happening? Could it be that the signal is terminating the container as well as the celery process?</p>
  
  <p>I am sending the signal with:
  <code>docker kill --signal="TERM" containerid</code>
  or <code>docker exec containerid kill -15 1</code></p>