2

maybe it's a silly question, but I didn't found much while googling around.

So I'm on the way to transform my development environment to a deploy environment. I connected django and nginx using uwsgi, put both in docker containers... so far no problem.

But I'm using django-rq, so I need a Worker process. In all these nice examples about deploying django I didn't found much about deploying django-rq. All I found was "create a docker container and use the manage.py " like this:

CMD python manage.py rqworker [queue1] [queue2]

Really? Should I just start the worker like this? I think manage.py is just for testing!?

theother
  • 307
  • 2
  • 16
  • that is exactly how many many many many many people use it in production environments ... – Joran Beasley Apr 09 '22 at 01:36
  • Hmm, cool. Some things are so easy, you can't belive it. – theother Apr 09 '22 at 02:22
  • @JoranBeasley: if you post it as an answer, I will accept it as the right answer! – theother Apr 12 '22 at 16:12
  • This does not feel intuitive at all... Weird @Joran Beasley – Yamuk Nov 03 '22 at 13:01
  • why not @yamuk .. you would normally put it inside some sort of startup script like systemd ... but it just calls a command ... in fact all "services" in systemd or docker simply call commands ... you should not serve your webserver via manage.py runserver, but its absoutely ok to write other management commands that are fine to run in production ... (and rqworker is a command they wrote) – Joran Beasley Nov 04 '22 at 16:29

1 Answers1

0

You can create a systemd service in Ubuntu then enable and start the service.

FYR: https://github.com/rq/django-rq#deploying-on-ubuntu

Anishkumar
  • 31
  • 1
  • 6
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 21 '22 at 12:03
  • Well, a service is not the way I want to go with docker. But thanks for the answer. – theother Apr 23 '22 at 16:13