R
Railway•4mo ago
70

server deployment

error: [prestart:error] Usage: /assets/scripts/prestart.mjs <config-file> <output-file> after custom deployment command. I would like to add anotherstart command apart from the default ones is that possble if so how
17 Replies
Percy
Percy•4mo ago
Project ID: 5a0ee64c-4acb-4b7a-a156-b53fd08e9edd
70
70•4mo ago
5a0ee64c-4acb-4b7a-a156-b53fd08e9edd
Brody
Brody•4mo ago
what command would you like to add
70
70•4mo ago
node cron.js
Brody
Brody•4mo ago
is this a php or a node app?
70
70•4mo ago
php
Brody
Brody•4mo ago
whats with node then?
70
70•4mo ago
node /assets/scripts/prestart.mjs /assets/nginx.template.conf && (php-fpm -y /assets/php-fpm.conf & nginx -c /nginx.conf) && (node cron.js&) current start command oh its for a cronjob in the background
Brody
Brody•4mo ago
what does the cron job do?
70
70•4mo ago
checks something in the db
Brody
Brody•4mo ago
then you want a seprate railway service that only runs that cron job
70
70•4mo ago
how nd why
Brody
Brody•4mo ago
how: create a new railway service in the same project, have it deploy from the same repo, and set the start command to node cron.js why: because its a separate task, it should be ran in a separate service
70
70•4mo ago
ok ty i was thinking abt that but thought there was an easier wey 😄
Brody
Brody•4mo ago
this is the easy way
70
70•4mo ago
okay thanks 6 am time to sleep gn brody thanks again
Brody
Brody•4mo ago
happy to help!