Different docker entrypoint commands per instance

Is it possible to set multiple docker entrypoint commands for multiple instances of the same service?

I’m running a database backed queue from the same application code as my web service (using the same database that my web service interacts with). In order for this to work, I need to run different long-running commands for each instance. Is this possible in Render?

Thanks for the help.

Good question @kinney! If I’m understanding your architecture correctly, it sounds like your best bet is to create separate Render services for the web service and the database backed queue. These two services would probably use the same GitHub repo since the queue and application code are shared. Then you could either write separate Dockerfiles for the two services or use the same Dockerfile and supply different “Docker Commands” to override the ENTRYPOINT.

It is possible to run multiple processes side-by-side in the same service, but the multiple service approach is probably preferable. That way each service can be independently scaled to the desired number of instances.

Let us know if you have any follow up questions.

Thanks for getting back to me @david ! re being able to independently scale: that makes sense.

I would like to be able to kick off unscheduled tasks from my application code, too—meaning they would need to have access to a process running within my other service (a running consumer). Does this sound feasible?

Separately (and I don’t think practically problematic) my queue runs both a consumer and a scheduler, which means that I’ll probably want to spin up 2 separate services. Does that sound right to you?

Actually, nevermind! Wasn’t thinking through it properly. Appreciate your help - will let you know if other follow up questions come up.

My pleasure! It sounds like it may not still be relevant, but in case it’s helpful we somewhat recently started offering the ability to run unscheduled tasks: Run one-off tasks based on your existing services with Render Jobs. | Render

Thanks for the heads up!