I have two containers. One is used for holding my django application with gunicorn running and another is for the celery task queue.
Celery uses the same django application code base.
When I build Django docker container I use
ADD . /usr/src/app statement to copy source files into container. But Dockerfile for Celery lays in another folder, so there is no possibility to copy files in it as they are out of context.
So far I see two possibilities:
mount -o bindseems to look hacky
- keeping two copies of files can cause out-of-sync situation
- declare source code folder as a volume and start celery container with
Currently I use the third solution. Are there any better ways? Use
git clone in dockerfile? But how to auth then ...