web service's nixpack
startCommand
not being respected
mhuggins
HOBBYOP

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.toml

  • config/railway.worker.toml

  • config/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.toml

  • worker: NIXPACKS_CONFIG_FILE=config/railway.worker.toml

  • whenever: 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?

Solved

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 -

https://nixpacks.com/docs/guides/configuring-builds


mhuggins
HOBBYOP

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?


2 years ago

Yes, that config is done in the service settings.


mhuggins
HOBBYOP

2 years ago

Ahh, I see that now. Thank you!

Attachments


2 years ago

No problem!


Status changed to Solved brody over 1 year ago


Loading...