How to setup celery worker in django+redis project?
I have a
django
+celery
+redis
setup.
I can use django and redis no problem. I can also trigger endpoint to start task.
task func is defined within the django project.
Problem is those task dont get completed bc they are not sent to any celery worker.
How do I setup a celery worker in railway? I tried to start a new celery service and I cant find it from options. Do I pull it from a docker image?
This is my docker-compose.yaml
for how things are getting setup in my dev, if this can help understand my setup better
3 Replies
Project ID:
187a5a9d-3902-45ea-ab25-003405c7240a
187a5a9d-3902-45ea-ab25-003405c7240a
I solved my problem.
So I created a duplicate service, linking to the same github repo, same root path.
In settings, custom start command, I added
celery -A dj_project worker -l INFO -Q queue1
In entrypoint.sh used by dockerfile, I added a condition
yeah that's certainly one way to do it