startCommandnot being respected
2 years ago
I followed some advice from this discussion, and I created a nixpack file for each of my services (named "web", "worker", & "whenever").
My three nixpack files are named:
config/railway.web.tomlconfig/railway.worker.tomlconfig/railway.whenever.toml
Each of these nixpacks includes a [deploy] section with a startCommand.
I've also set the NIXPACKS_CONFIG_FILE environment variable on each of these services accordingly:
web:
NIXPACKS_CONFIG_FILE=config/railway.web.tomlworker:
NIXPACKS_CONFIG_FILE=config/railway.worker.tomlwhenever:
NIXPACKS_CONFIG_FILE=config/railway.whenever.toml
Unfortunately, the start command is only being respected by the worker & whenever services; it is not being respected by the web service.
My railway.web.toml file contains the following:
[phases.setup]
providers = ['...', 'ruby']
[deploy]
startCommand = 'bundle exec rails db:prepare db:seed && bundle exec rails server -b 0.0.0.0 -p ${PORT:-3000} -e $RAILS_ENV'I've made sure to delete both Procfile and Dockerfile that were in my project's root as well.
Is there any other reason that my web service would not be using the startCommand provided in the nixpacks file?
5 Replies
2 years ago
You are mixing a railway.toml and a nixpacks.toml file together.
Please see this docs page for the correct nixpacks.toml syntax -
2 years ago
If I have a single repo for multiple services, is it possible to supply multiple railway.toml files, one for each service?
Status changed to Solved brody • over 1 year ago