Background jobs in production using docker

There is nothing specific in the docs on how to run the background jobs using docker in production and was wondering if there was a suggested way on how to do it.
Running yarn rw jobs start in the api_serve step should do the trick right?

Hey! Yeah I think any stage with the built API side will be able to perform your jobs. You will need to have the cli available to run that command you have there so you might need to tweak the yarn install not to focus on production dependencies in that case.

I double checked the CLI command it looks like you’d be safe to just directly call the underling job binary we have which is yarn rw-jobs. That would mean you don’t need the dev dependencies only the production ones already in the api side.

There’s also this section in the jobs docs that mentions rw-jobs-worker: background-jobs#advanced-job-workers that’d be good to reference

is this kind of the equivalent to rw-server?
In our docker we use
yarn rw-server api
so adding
yarn rw-jobs-worker afterwards would be convenient :slight_smile:

Yeah, I ended up calling the binary with node_modules/.bin/rw-jobs start.
Strangely enough using node_modules/.bin/rw-jobs-worker --index=0 --id=0 stalled my server so couldn’t use that. Didn’t look too much into it and don’t have any logs for this issue unfortunately.

1 Like

What did you do for logging?