Currently, I create a Celery worker + Flower monitoring solution based on
https://github.com/itsrifat/flask-celery-docker-scale
Celery worker and Flower monitoring both run in a same directory flask-celery
The reason is that, so that Flower has access to Celery worker code module, and the following command with -A
flag would work
entrypoint: flower
command: -A tasks --port=5555 --broker=redis://redis:6379/0
This is what their docker-compose.yml looks like
worker:
build:
context: ./flask-celery
dockerfile: Dockerfile
depends_on:
- redis
monitor:
build:
context: ./flask-celery
dockerfile: Dockerfile
ports:
- "5555:5555"
entrypoint: flower
command: -A tasks --port=5555 --broker=redis://redis:6379/0
depends_on:
- redis
Now, I would like to create another new worker task2.py
code, which will sit inside new directory called flask-celery2
.
So, how should I modify the Dockerfile
and docker-compose.yml
so that flower will be capable of monitoring both tasks
and tasks2
?