Procfile with web & worker should create two services, right?
Rails 6 app with this Procfile:
I added PostgreSQL service and Redis service
Then I add Github repo.
Only one service appears and start of Build logs looks like this:
I can see "start" has the 2nd line of my
Procfile
and if I let it go fully, I have a Sidekiq
process running, but not a Puma
server.
The only issue I can think of is I'm not deploying from master
, I have a separate branch on my repo called railway
and after the service is connected, I abort the first deploy from master
and switch it over to the railway
branch.
Could this be causing the issue as it reads from the master branch initially?5 Replies
Project ID: 9ddc4dfb-ab3f-4809-8481-9657a0c52a43
I haven't seen your repo yet but is your Procfile in your .gitignore?
No, just checked.
However, my procfile for my
master
branch is different:
The master branch is still deployed on Heroku, so I was trying to use a separate branch to deploy to Railway.IIRC you need to create a separate service to deploy your
worker
process.
My recommendation would be that on your railway
branch, remove the Procfile
.
Then:
1. In your first service, under settings, set a start command of /bin/bash -l -c "rails db:migrate && bundle exec puma -C config/puma.rb"
2. In your second service, under settings, set a start command of /bin/bash -l -c "bundle exec sidekiq -C config/sidekiq.yml"
^ This is assuming those are your start commands for the web
and worker
processes.This worked! Instead of creating services from GitHub, I created empty services, set the start commands and then linked to GitHub, which allowed me to set the branch before they started to build. Might be worth addding something to the docs about deploying when not using
master
or main
.