-
So, yesterday I managed to deploy a pet project to Railway based on this template. Like most other "serverless" hosting providers, they provide a lot of convenience at the cost of being less flexible about stuff. Neither Railway, Heroku, or Render support a native But since It did require doing two things: Adding the following to
And binding to Railway's
But what about a 2nd service?I know this is a project that is supposed to work where docker-compose works, but I was wondering what are my options here if I want to add Railway doesn't support private images yet, so I can't publish one to a repository and use that. The only option left is another Note: I'm looking to spin up this additional service inside a different dyno/vm/container. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi, Here's a couple of notes:
I never used Railway but the only difference between Celery and gunicorn here is which command gets run when your container starts. Both services share the same code base and can use the same Dockerfile. I don't know what Railway has for running multiple services but hopefully you can feed it the Celery command for your worker service and the gunicorn command for your web service. If not, then I would question that service because that's a really basic feature. I guess in the worst case scenario you can use the entrypoint script to pick which service to run based on setting an ENV var. This way both commands are defined in the entrypoint script and you'd set different env vars for the Celery or gunicorn services. For example you can have I don't love this though because that's way different than how things will work in development and everywhere else besides Railway. You could introduce another env var like |
Beta Was this translation helpful? Give feedback.
-
Thanks @nickjj.
Looks like they do (see img, or link) So I guess I can provide the override like so: web:
celery/dramatiq:
I wonder though, since I modified
Given that the Dockerfile references: |
Beta Was this translation helpful? Give feedback.
-
Oh wait, actually it says:
|
Beta Was this translation helpful? Give feedback.
It sounds like you can supply a custom start command which means you're good to go without much complexity around entrypoint scripts and env vars. You can supply a different start command for your background worker command.